Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Extensible enumerations in XML Schema

From: George Cristian Bina <george@---------.--->
To: andreas.ebbert-karroum@-----.---
Date: 11/28/2006 2:18:00 PM
Hi Andreas,

When you define an element to substitute other element then the element 
type must be derived from the type of the element it should substitute.
A union of two types is not derived from string even if both types are 
restrictions of string, at least not according with the specification.

When using string instead of anySimpleType Xerces through oXygen reports
SystemID: C:\george\test\p1\test.xsd
Location: 30:41
Description: e-props-correct.4: The {type definition} of element 
'extendedState' is not validly derived from the {type definition} of the 
substitutionHead ':baseState', or the {substitution group exclusions} 
property of ':baseState' does not allow this derivation.
URL: http://www.w3.org/TR/xmlschema-1/#e-props-correct

That is it points to point 4 from 
http://www.w3.org/TR/xmlschema-1/#e-props-correct
***
4 If there is a {substitution group affiliation}, the {type definition} 
of the element declaration must be validly derived from the {type 
definition} of the {substitution group affiliation}, given the value of 
the {substitution group exclusions} of the {substitution group 
affiliation}, as defined in Type Derivation OK (Complex) (=A73.4.6) (if 
the {type definition} is complex) or as defined in Type Derivation OK 
(Simple) (=A73.14.6) (if the {type definition} is simple).
***

That is this refers to
Type derivation Ok (Simple)
http://www.w3.org/TR/xmlschema-1/#cos-st-derived-ok
***
Schema Component Constraint: Type Derivation OK (Simple)

For a simple type definition (call it D, for derived) to be validly 
derived from a type definition (call this B, for base) given a subset of 
{extension, restriction, list, union} (of which only restriction is 
actually relevant) one of the following must be true:
1 They are the same type definition.
2 All of the following must be true:
2.1 restriction is not in the subset, or in the {final} of its own {base 
type definition};
2.2 One of the following must be true:
2.2.1 D's =B7base type definition=B7 is B.
2.2.2 D's =B7base type definition=B7 is not the =B7ur-type definition=B7 =
and is 
validly derived from B given the subset, as defined by this constraint.
2.2.3 D's {variety} is list or union and B is the =B7simple ur-type 
definition=B7.
2.2.4 B's {variety} is union and D is validly derived from a type 
definition in B's {member type definitions} given the subset, as defined 
by this constraint.
Note: With respect to clause 1, see the Note on identity at the end of 
(=A73.4.6) above.
***

And here you can see that the only 2.2 clause that applies in this case i=
s
2.2.3 D's {variety} is list or union and B is the =B7simple ur-type 
definition=B7.

Therefore B needs to be anySimpleType because D is a union.

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
www.---.com


andreas.ebbert-karroum@n... wrote:
> Hello George,
> 
> Thanks for your valuable comments :-) Please find my answers inline bel=
ow:
> 
>> -----Original Message-----
>> From: ext George Cristian Bina [mailto:george@o...] 
>> Subject: Re: Extensible enumerations in XML Schema
> 
>> You can define the base state to be anySimpleType. Then define 
>> the extendedRequestState as a union:
>>
>> <xs:simpleType name="extendedRequestState">
>>     <xs:union memberTypes="ns0:RequestState">
>>       <xs:simpleType>
>>         <xs:restriction base="xs:string">
>>           <xs:enumeration value="open.running.new1"/>
>>           <xs:enumeration value="open.running.new1"/>
>>           <xs:enumeration value="open.running.new1"/>
>>         </xs:restriction>
>>       </xs:simpleType>
>>     </xs:union>
>>   </xs:simpleType>
> 
>>From my understanding that should also work, when the baseState is a st=
ring, but it does not. What's the reason for that? 
> 
>> As a side note, in Relax NG that is really easy
> 
> I'm bound to XML Schema, sorry. But interesting to read, how it is done=
 with Relax NG.
> 
>  _         __                _  _
> //\ndreas.[|-bbert-[]/arroum(a)[|\|okia.com
>            `-        `
>    Andreas Ebbert-Karroum
>          Senior Software Design Engineer
>                 Nokia Networks Services / Middleware 
>    phone: +49-211-94123928, fax: +49-211-9412-3838
>    Heltorfer Stra=DFe 1, 40472 D=FCsseldorf, Germany 
> 
> ----------------------------------------------------------------------
> This message is confidential. If you have received this message in erro=
r,
> please delete it from your system. You should not copy it for any purpo=
se,
> or disclose its contents to any other person. Internet communications a=
re
> not secure and therefore Nokia GmbH does not accept legal responsibilit=
y
> for the contents of this message as it has been transmitted over a publ=
ic
> network. Thank you.
> Nokia GmbH, Nokia Networks is a German Company. Further information
> about the Company is available from its principal offices at
> Heltorferstrasse 1, D-40472, D=FCsseldorf, Germany and from the
> website at http://www.nokia.com/
> ----------------------------------------------------------------------
> 


From ejohnson@e... Tue Nov 28 15:37:52 2006
Received: from maggie.w3.org ([193.51.208.68])
	by frink.w3.org with esmtp (Exim 4.50)
	id 1Gp51s-0000jM-Fh
	for 


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent