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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: [xml-dev] Problems with xs:redefine

[ Lists Home | Date Index | Thread Index ]
  • To: Michael Kay <mike@saxonica.com>
  • Subject: RE: [xml-dev] Problems with xs:redefine
  • From: Kasimier Buchcik <K.Buchcik@4commerce.de>
  • Date: Thu, 24 Nov 2005 17:02:01 +0100
  • Cc: ML-xml-dev <xml-dev@lists.xml.org>
  • In-reply-to: <E1EfINQ-0006hF-I1@mail.firmenpost.de>
  • References: <E1EfINQ-0006hF-I1@mail.firmenpost.de>

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








 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS