XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Can every Salami Slice schema can be converted to anequivalent Russian Doll schema?

On Mon, Feb 21, 2022 at 10:57 PM Roger L Costello <costello@mitre.org> wrote:

Here’s why: XML Schema does not allow an element to hold two child elements with the same name unless the child elements can be determined to have the same type. A human can visually look at the Russian Doll schema and see that the two A elements have the same type:

<xs:simpleType>
    <xs:restriction base="xs:string">
        <xs:enumeration value="A"/>
    </xs:restriction>
</xs:simpleType>

 


Although, the lexical schema type definition,

<xs:simpleType>
    <xs:restriction base="xs:string">
        <xs:enumeration value="A"/>
    </xs:restriction>
</xs:simpleType>

appearing at two different places, look to be equivalent type definitions, I think an XSD processor shouldn't be attempting to determine this XSD type equality (in a general case, it'd be very hard to determine XSD type equality by comparing in-memory XSD type component definitions).

Consider, the following XSD 1.1 type definitions,

<xs:simpleType>
    <xs:restriction base="xs:string">
        <xs:assertion test="$value = 'A'"/>
    </xs:restriction>
</xs:simpleType>

<xs:simpleType>
    <xs:restriction base="xs:string">
         <xs:assertion test="$value = 'B'"/>
    </xs:restriction>
</xs:simpleType>

Its nearly impractical, to determine whether such type definitions are equal.

 
--
Regards,
Mukul Gandhi


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


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

Copyright 1993-2007 XML.org. This site is hosted by OASIS