[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Subject: Re: Syntax for global attribute
I don't know why I didn't see this earlier. There is no need for the global attribute. Instead of <attribute name="foo" global="true">p</attribute> you can simply do <attribute><name>foo</name> p </attribute> since the <name> element always inherits the ns attribute. I think the solution that I proposed below of inheriting the namespace map into included grammars would add too complexity to the spec and would be just too strange. I would therefore propose closing this issue by removing the global attribute. --On 18 June 2001 13:42 +0700 James Clark <jjc@jclark.com> wrote: > 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 > > > > > > > ------------------------------------------------------------------ > To unsubscribe from this elist send a message with the single word > "unsubscribe" in the body to: relax-ng-request@lists.oasis-open.org > >
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Powered by eList eXpress LLC