[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Problems with xs:redefine
Hi, On Thu, 2005-11-24 at 14:47 +0000, Michael Kay wrote: > > > > A 'same declaration' could also be an identical component, > > couldn't it? > > If yes, then shouldn't the following model be accepted by > > Saxon as well? > > I'm a bit scared of the necessity of component identity checks here. > > > > <xs:choice> > > <xs:element name="a"/> > > <xs:element name="b"/> > > <xs:sequence> > > <xs:element name="a"/> > > <xs:element name="b"/> > > </xs:sequence> > > </xs:choice> > > > > The term "identity" is a bit confusing here. As far as Saxon is concerned, The term 'component identity' refers to a note in the schema spec at http://www.w3.org/TR/xmlschema-1/#no-identity. > if you write > > <choice> > <element ref="a"/> > <element ref="a"/> > </choice> > <element name="a"/> > > then there are two element particles and one element declaration, while if > you write > > <choice> > <element name="a"/> > <element name="a"/> > </choice> > > then there are two particles and two declarations. Two declarations are not > considered identical merely because they have the same content. Yes. In terms of components: the two local element declaration components cannot be the same instance, but they can be 'identical'. If I understand the term 'identical' wrt it's meaning in XML Schema correctly, then the two components in the presented scenario are 'identical' if one can substitute both of them for a global declaration without changing the semantics of the schema. This means they need to have identical properties, identical type, identical substitution group members and whatever. In the above scenario the local declarations could be obviously substituted for references to a global declaration; this would make the scenario valid in Saxon. But one would need to do this by hand; i.e. Saxon does not _see_ that both local declarations are identical. This seems a bit inconsistent, as one would misuse the @ref mechanism to actually tweak the content model to be accepted, without changing any semantics. Wouldn't this confuse people even more? So is this a feature (and that's how I interpreted your remark about the 'bug' in the spec), or does this do more harm that good? Regards, Kasimier
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|