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

RE: Substitution Groups


substitution group qname
Thanks to all who replied. I think my brain had turned to mush from looking
at too many schemas, very few of which were valid.

I looked again in the light of your replies, which basically confirmed what
I had thought was the only sensible way for substitution groups to work. The
problem turned out to be that, in the model I am working from, the schema
document that contains the head of the substitution group also directly
references one of the substituted elements. I will go back to the modeller
to see if this is what was intended or whether he intended to reference the
head of the group. Either way, implementation is possible, just messier if
he intended the model as written as it requires two additional schema
documents to avoid circular references.

Regards

Paul Spencer

> -----Original Message-----
> From: Michael Kay [mailto:mike@s...]
> Sent: 19 February 2005 08:55
> To: 'Paul Spencer'; 'Xml-Dev'
> Subject: RE:  Substitution Groups
>
>
> > File A defines a complex data type AType and an element A of
> > that type.
> >
> > File B defines a complex type BType that is an extension of
> > AType and an
> > element B of that type. Element B is in the substitution
> > group for element
> > A.
> >
> > It as an error if File B does not <include> file A since the
> > XML Processor
> > can't find the head of the substitution group.
> >
> > File A must <include> file B otherwise an instance that uses
> > element B will
> > be invalid.
>
> The schema rec contains some contradictory statements on this.
>
> Section 3.15.3 says:
>
> "For a .QName. to resolve to a schema component of a specified kind all of
> the following must be true:
> 1 That component is a member of the value of the appropriate
> property of the
> schema which corresponds to the schema document within which the .QName.
> appears,": in other words, component references in document A must resolve
> to something in the include tree rooted at A.
>
> However, section 3.1.3 and elsewhere contain statements like "Forward
> reference to named definitions and declarations is allowed, both
> within and
> between .schema documents.." with the implication that when a component A
> references a component B, component B can be anywhere: it doesn't
> have to be
> in a schema document included or imported by the document containing A.
>
> The advice I've had on xmlschema-dev (and which I've implemented in Saxon)
> is that the second statement is correct and the first one is wrong.
>
> Given this confusion in the spec, however, it's not surprising to find
> differences between implementations.
>
> Michael Kay
> http://www.saxonica.com/
>
>


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.