[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Subject: Re: QNames
James Clark wrote: > > I have to admit I like none of my alternatives. > > Of your alternatives the one I dislike the least is the first (which is > really no different from the second as far as the RELAX NG spec is > concerned). I wonder whether this already hits 80-20. Since namespaces typically correspond to information islands, elements of a namespace share one top-level element or a sequence of such top-level elements. See my rewrite of RSS in RELAX NG. > Here's some more alternatives: I can live with all of them. > E) > Like you example 1, ie as now but name attributes are not allowed to be > qualified, but allow <grammar> elements to group definitions using <div> > elements as in RELAX NG. The div elements don't change the semantics of > the enclosed definitions, but, as well as being useful for annotations > and structuring large grammars, they can have common attributes > including "namespace". Then for a mixed namespace grammar you could use > the following technique: By the way, one reason that RELAX Core has <div> is to make clear the scope of annotation. Given <div><annotation>....</annotation> whatever whatever </div>, this annotation is about all subordinates of this <div> element. > Of these, I prefer E, although I still much prefer QNames... We can also try to extend the namespace rec. If an instance document explicitly indicates which attribute contains QName, any general-purpose XML program can successfully rename prefixes without causing any problems. Cheers, Makoto --------------------------------- <!-- Rewrite in RELAX NG MURATA Makoto June 4, 2001 --> <!-- Draft TREX Grammar for RSS 1.0 Leigh Dodds 10/1/2001 --> <grammar namespace="http://purl.org/rss/1.0/" xmlns="http://relaxng.org/ns/struct/0.9"> <start> <element name="RDF" namespace="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <ref name="Channel" /> <optional> <ref name="Image" /> </optional> <oneOrMore> <ref name="Item" /> </oneOrMore> <optional> <ref name="Textinput" /> </optional> </element> </start> <define name="Channel"> <element name="channel"> <attribute name="about" namespace="http://www.w3.org/1999/02/22-rdf-syntax-ns#" /> <interleave> <ref name="Title"/> <ref name="Link"/> <ref name="Description"/> <optional> <ref name="Image.ref"/> </optional> <ref name="Items" /> <optional> <ref name="Textinput.ref"/> </optional> </interleave> </element> </define> <define name="Image"> <element name="image"> <attribute name="about" namespace="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/> <interleave> <ref name="Title"/> <ref name="Url"/> <ref name="Link"/> </interleave> </element> </define> <define name="Image.ref"> <element name="image"> <attribute name="resource" namespace="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/> <empty/> </element> </define> <define name="Item"> <element name="item"> <attribute name="about" namespace="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/> <interleave> <ref name="Title"/> <ref name="Link"/> <optional> <ref name="Description"/> </optional> </interleave> </element> </define> <define name="Items"> <element name="items"> <element name="Seq" namespace="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <oneOrMore> <element name="li"> <attribute name="resource"/> <empty/> </element> </oneOrMore> </element> </element> </define> <define name="Textinput"> <element name="textinput"> <attribute name="about" namespace="http://www.w3.org/1999/02/22-rdf-syntax-ns#" /> <interleave> <ref name="Title"/> <ref name="Description"/> <ref name="Name"/> <ref name="Link"/> </interleave> </element> </define> <define name="Textinput.ref"> <element name="textinput"> <attribute name="resource" namespace="http://www.w3.org/1999/02/22-rdf-syntax-ns#" /> </element> </define> <define name="Title"> <element name="title"> <anyString/> </element> </define> <define name="Url"> <element name="url"> <anyString/> </element> </define> <define name="Link"> <element name="link"> <anyString/> </element> </define> <define name="Description"> <element name="description"> <anyString/> </element> </define> <define name="Name"> <element name="name"> <anyString/> </element> </define> </grammar>
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Powered by eList eXpress LLC