Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: Extensible enumerations in XML Schema

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

thanks a million, you saved my day :-) 

I've read that part of the spec so many times and never really =
understood it. Now I did!

Thanks again,
 _         __                _  _
//\ndreas.[|-bbert-[]/arroum(a)[|\|okia.com
           `-        `
   Andreas Ebbert-Karroum
      =A0=A0 Senior Software Design Engineer
                Nokia Networks Services / Middleware 
=A0=A0 phone: +49-211-94123928, fax: +49-211-9412-3838
=A0=A0 Heltorfer Stra=DFe 1, 40472 D=FCsseldorf, Germany 

----------------------------------------------------------------------
This message is confidential. If you have received this message in =
error,
please delete it from your system. You should not copy it for any =
purpose,
or disclose its contents to any other person. Internet communications =
are
not secure and therefore Nokia GmbH does not accept legal responsibility
for the contents of this message as it has been transmitted over a =
public
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/
---------------------------------------------------------------------- 

>-----Original Message-----
>From: ext George Cristian Bina [mailto:george@o...] 
>Sent: 28 November, 2006 11:18
>To: Ebbert-Karroum Andreas (Nokia-NET/Dusseldorf)
>Cc: xmlschema-dev@w...
>Subject: Re: Extensible enumerations in XML Schema
>
>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 is
>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 below:
>> 
>>> -----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 string, 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 
>> error, please delete it from your system. You should not copy it for 
>> any purpose, or disclose its contents to any other person. Internet 
>> communications are not secure and therefore Nokia GmbH does 
>not accept 
>> legal responsibility for the contents of this message as it has been 
>> transmitted over a public 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 george@oxygen


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