Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <xs:schema targetNamespace="test-namespace" xmlns:tns="test-namespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
- <!-- 'bam.xsd' defines 'complexTypeBam' to have child 'addedByBam' -->
- <!-- 'baz.xsd' redefines 'bam.xsd: complexTypeBam' to have children 'addedByBam', 'addedByBaz' -->
- <!-- 'foo.xsd is redefining 'baz.xsd: complexTypeBam' to have children 'addedByBam', 'addedByBaz', 'addedByFoo' -->
- <xs:redefine schemaLocation="baz.xsd">
- <xs:complexType name="complexTypeBam"><xs:complexContent>
- <xs:extension base="tns:complexTypeBam"><xs:sequence>
- <xs:element minOccurs="1" name="addedByFoo" type="xs:string" />
- </xs:sequence></xs:extension>
- </xs:complexContent></xs:complexType>
- </xs:redefine>
- <!-- It seems like 'complexTypeBam' is intermediately defined to have children 'addedByBam', 'addedByBaz' -->
- <!-- not yet including the 'addedByFoo' nor 'addedByBar' as happens below -->
- <!-- REMINDER: 'bam.xsd' defines 'complexTypeBam' to have child 'addedByBam' -->
- <!-- 'bar.xsd' redefines 'bam.xsd complexTypeBam' to have children 'addedByBam', 'addedByBar' -->
- <!-- BUT content included through 'bar.xsd' thinks that 'complexTypeBam' has children 'addedByBam', 'addedByBaz', 'addedByBar' -->
- <xs:include schemaLocation="bar.xsd" />
- <!-- content local to this schema ('foo.xsd') thinks that 'complexTypeBam' has children 'addedByBam', 'addedByBaz', 'addedByFoo' -->
- <xs:element name="redefinedByFoo" type="tns:complexTypeBam" />
- <xs:element name="elementRootFoo"><xs:complexType><xs:sequence>
- <!-- this element uses the local redefine -->
- <xs:element ref="tns:redefinedByFoo" />
- <!-- the below use the redefine included in 'bar.xsd' -->
- <xs:element ref="tns:redefinedByBar" />
- <xs:element ref="tns:redefinedByBaz" />
- <xs:element ref="tns:elementBam" />
- </xs:sequence></xs:complexType></xs:element>
- </xs:schema>
- <elementRootFoo xmlns="test-namespace" xsi:schemaLocation="test-namespace foo.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <redefinedByFoo>
- <addedByBam />
- <addedByBaz />
- <addedByFoo /> <!-- NOTE: 'addedByFoo' -->
- </redefinedByFoo>
- <redefinedByBar>
- <addedByBam />
- <addedByBaz /> <!-- NOTE: 'addedByBaz' when 'bar.xsd' redefines from 'bam.xsd' directly -->
- <addedByBar /> <!-- NOTE: 'addedByBar' -->
- </redefinedByBar>
- <redefinedByBaz>
- <addedByBam />
- <addedByBaz />
- <addedByBar /> <!-- NOTE 'addedByBar' -->
- </redefinedByBaz>
- <elementBam>
- <addedByBam />
- <addedByBaz />
- <addedByBar /> <!-- NOTE: 'addedByBar' -->
- </elementBam>
- </elementRootFoo>
- <xs:schema targetNamespace="test-namespace" xmlns:tns="test-namespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
- <xs:redefine schemaLocation="bam.xsd">
- <xs:complexType name="complexTypeBam"><xs:complexContent>
- <xs:extension base="tns:complexTypeBam"><xs:sequence>
- <xs:element minOccurs="1" name="addedByBar" type="xs:string" />
- </xs:sequence></xs:extension>
- </xs:complexContent></xs:complexType>
- </xs:redefine>
- <xs:element name="redefinedByBar" type="tns:complexTypeBam" />
- </xs:schema>
- <xs:schema targetNamespace="test-namespace" xmlns:tns="test-namespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
- <xs:redefine schemaLocation="bam.xsd">
- <xs:complexType name="complexTypeBam"><xs:complexContent>
- <xs:extension base="tns:complexTypeBam"><xs:sequence>
- <xs:element minOccurs="1" name="addedByBaz" type="xs:string" />
- </xs:sequence></xs:extension>
- </xs:complexContent></xs:complexType>
- </xs:redefine>
- <xs:element name="redefinedByBaz" type="tns:complexTypeBam" />
- </xs:schema>
- <xs:schema targetNamespace="test-namespace" xmlns:tns="test-namespace" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
- <xs:complexType name="complexTypeBam">
- <xs:sequence>
- <xs:element minOccurs="1" name="addedByBam" type="xs:string" />
- </xs:sequence>
- </xs:complexType>
- <xs:element name="elementBam" type="tns:complexTypeBam" />
- </xs:schema>
Add Comment
Please, Sign In to add comment