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] XSD substitution groups, subtypes, nillable .. thewhole sm

[ Lists Home | Date Index | Thread Index ]

Soren Kuula wrote:

Blast, I pressed the trigger too soon.

Corrected version:

> Hi, I'm trying to make a simpler structure for XML Schema -- by making 
> implicit stuff explicit.
>
> If I have three types: a > b > c, meaning c is derived by extension 
> from b, b is derived by extension from a
>
> --- scenario 1 ---
>
> For a declaration:
>
>   element x of type a
>
> I take that to mean:
>
> There are three declaration of an element named x:
>
> There is a declared element with name x, type a, and an optional 
> attribute xsi:type with values in {a} and an optional attribute 
> xsi:nil with values in{false}
>
> There is a declared element with name x, with type b, and a required 
> attribute xsi:type with values in {b} and an optional attribute 
> xsi:nil with values in{false}
>
> There is a declared element with name x, with type c, and a required 
> attribute xsi:type with values in{c} and an optional attribute xsi:nil 
> with values in{false}
>
>
> Any big conceptual mistakes there? Hope not :)
>
> Now if I add
>
>   element y of type b
>
> that will then be
>
> There exist two declaration of an element named y:
>
> One with type b, and an OPTIONAL attribute xsi:type with values in {b} 
> and an optional attribute xsi:nil with values in {false}
> One with type c, and a required attribute xsi:type with values in {c} 
> and an optional attribute xsi:nil with values in {false}
>
> right?
>
> --- scenario 2 ---
>
> If I do
>
>   element x of type a subsitutionGroup="y"
>
>   element y of type b
>
> (with the same implications for implied declarations as above)
>
> can the (first) implied-declaration
>
> There exists a declared element named x with type a, and an optional 
> attribute xsi:type with values in {a} and an optional attribute 
> xsi:nil with values in {false}
>
> ever substitute an y element? As far as I understand no, but I'd be 
> happy to have a confirmation.
>
> --- scenario 3 ---
>
> I take a declaration
>
>   element y of type b nillable="false"
>
> to mean
>
> There exists a declared element named y with type b, and an optional 
> attribute xsi:type with values in {b} and an optional attribute 
> xsi:nil with  values in {false}
>
> and
>
>   element y of type b nillable="true"
>
> to mean
>
> There exists a declared element named y with type b, and an optional 
> attribute xsi:type with values in {b}, and an optional attribute named 
> xsi:nil with values in {false}
>
> There exists a declared element named y with type #EMPTY, and an 
> optional attribute xsi:type with values in {b}, and a required 
> attribute named xsi:nil with values in {true}
>
> i) How are the other implied declarations; are there 1 or 2 of them? 
> One of these must be true:
>
> (R)
> There exists a declared element named y with type c, and a required 
> attribute xsi:type with values in {c}, and an optional attribute named 
> xsi:nil with values in {false}
>
> OR
>
> (S)
> (
> There exists a declared element named y with type c, and a required 
> attribute xsi:type with values in {c}, and an optional attribute named 
> xsi:nil with values in {false}
>
> and
>
> There exists a declared element named y with type #EMPTY, and a 
> required attribute xsi:type with value s in {c}, and an required 
> attribute named xsi:nil with values in {true}
> )
>
> Which one is it ? :)
>
> --- Scenario 4 ---
>
> if I have
>
>   element x of type b nillable="true" substitutionGroup = "y"
>
>   element y of type b nillable="false"
>
> is is true or false, or absurd to even talk about that elements of the 
> implicit declaration
>
> There exists a declared element named x with type #EMPTY, and an 
> optional attribute xsi:type with values in {b}, and a required 
> attribute named xsi:nil with values in {true}
>
> can substitute elements declared by
>
> There exists a declared element named y with type b, and an optional 
> attribute xsi:type with values in {b}, and an optional attribute named 
> xsi:nil with values in {false}
>
> (I sure as XML Schema hope it's false)
>
> --- Scenario 5, final one ---
>
> if I have
>
>   element x of type b nillable="true" substitutionGroup = "y"
>
>   element y of type b nillable="true"
>
> is is true or false that elements of the implicit declaration
>
> There exists a declared element named x with type #EMPTY, and an 
> optional attribute xsi:type with values in {b}, and a required 
> attribute named xsi:nil with values in {true}
>
> can substitute elements declared by
>
> There exists a declared element named y with type #EMPTY, and an 
> optional attribute xsi:type with value in {b}, and a required 
> attribute named xsi:nil with values in {true}
>
> my bold guess is that it's true, but maybe....
>
>
>
> All right, I could go looking for the answers in the spec, but 
> honestly, I don't have the courage for that; I'm still in R&R after my 
> last encounter with it. My hope with this is that someone really 
> knowledgeable about XML Schema can fill me / us in on it, and together 
> we have then contributed a really simple way to tell how the whole 
> subtyping / subst grp / nillable thing works.
>
> Soren

Soren




 

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

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