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

Re: XSD substitution groups, subtypes, nillable .. thewhole


xsd substitution groups
Henry S. Thompson wrote:

>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>Thanks for clarifying -- before going further in constructing a reply,
>we need to fix something:
>
>Given
>
>  
>
>><complexType name="a">
>>  <!--- some model --->
>></complexType>
>>
>><complexType name="b">
>>  <extension base="a">
>>     <!--- some model -->
>>  </extension>
>></complexType>
>>    
>>
>
>then
>
>  
>
>><element name="x" type="a" substitutionGroup="y"/>
>>
>><element name="y" type="b"/>
>>    
>>
>
>is backwards, i.e. not allowed as written.  For x to be in the
>substitution group of y, x's type must be or be derived from y's type,
>but in this case it's the other way around.
>
>Does this invalidate the rest of your questions about this example, or
>should we just reverse 'a' and 'b' in this example, or . . .?
>  
>
The other examples do not have this feature. At least, they were not 
intended to, and they are not supposed to depend on anything defined in 
that example (scenario 2)

The question in scenario 2 can be reformulated to:

Given the declarations, what is the case?

- The schema is plain "statically" invalid, and should be rejected as such
- The schema is a valid XML Schema, but no instance document that 
substitutes an y-element by an a-typed x-element will validate
- The schema is a valid XML Schema, but no instance document that 
substitutes an y-element by any x element will validate
- The schema will validate a document where an a-typed x element appears 
in place of an y element
- Something else?

I have a hard time reading the intended meaning out of the spec, except 
that I have a fairly good idea that the 4th option is not the right one :)

If this particular example is too much trouble, we can leave it for 
later, and take the others first.

Meanwhile, I begin to realise that I have probably misunderstood 
something about the final / disallowed substitutions is related to
- type substitutions, not only substitution groups
- substitution by substitution group members can be switched on or off 
entirely with final / disallowed substitutions

Substitution group exclusions (aka block) limits the types of 
substutiteable elements (but it does not restrict anything that does not 
have to do with substitution groups)

--- anyway I think I know of a way to squeeze that semantics into my 
"many constructs, single declarations --> few constructs, many 
declarations" simplification.

Thanks again

Soren

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.