[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Problems with xs:redefine

  • To: Michael Kay <mike@s...>
  • Subject: RE: Problems with xs:redefine
  • From: Kasimier Buchcik <K.Buchcik@4...>
  • Date: Thu, 24 Nov 2005 17:02:01 +0100
  • Cc: ML-xml-dev <xml-dev@l...>
  • In-reply-to: <E1EfINQ-0006hF-I1@m...>
  • References: <E1EfINQ-0006hF-I1@m...>

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!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.