OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

relax-ng message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Subject: Syntax for global attribute


One argument against the global attribute is that there is already a way to
do this.  Instead of

<grammar ns="http://www.example.com">

<start>
  <element name="foo">
    <attribute name="bar" global="true"/>
  </element>
</start>

</grammar>

you can simply to:

<grammar ns="http://www.example.com" xmlns:eg="http://www.example.com">
  <element name="foo">
    <attribute name="eg:bar"/>
  </element>
</grammar>

However, there is a difference between these two techniques. The "ns"
attribute allows "chameleon" schemas.  That is, you can write a <grammar>
without an "ns" attribute; when you include the <grammar> in another
<grammar>, the included <grammar> inherits the "ns" attribute from the
including <grammar>.  This is extremely useful.  For example, if you have
two versions of a schema, each with a different namespace, you can put the
common part in a <grammar> without a "ns" attribute; each version then
specifies an "ns" attribute and includes the common part.  XHTML
modularization allows for use of XHTML modules where the XHTML elements take
on the namespace of the language into which they are incorporated.

The use of the second technique above loses the chameleon aspect of the "ns"
attribute. Maybe the solution is for included <grammar>s to inherit the
namespace map as well as the "ns" attribute; then we can get rid of the
global attribute without loss of functionality.  The argument against this
would be that it would mean that we were interpreting QNames in attribute
values in a different way from how XML Namespaces interprets QNames as
element names or attribute names; but our handling of unprefixed means that
we are already doing this differently.

James







[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]


Powered by eList eXpress LLC