Mega Code Archive

 
Categories / XML / XML Schema
 

Different types with the same name

File: Data.xml <?xml version="1.0"?> <BookOnCars xmlns="http://www.rntsoft.com"                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"                xsi:schemaLocation=                               "http://www.rntsoft.com                                ScopeTest.xsd">         <Chapter>                 <Title>title</Title>                 <Section>                     <Title>title</Title>                 </Section>         </Chapter>         <Title>A car</Title> </BookOnCars> File: ScopeTest.xsd <?xml version="1.0"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"             targetNamespace="http://www.rntsoft.com"             xmlns="http://www.rntsoft.com"             elementFormDefault="qualified">     <xsd:element name="BookOnCars">         <xsd:complexType>             <xsd:sequence>                 <xsd:element name="Chapter">                     <xsd:complexType>                         <xsd:sequence>                             <xsd:element name="Title" type="xsd:string"/>                             <xsd:element name="Section">                                 <xsd:complexType>                                     <xsd:sequence>                                         <xsd:element name="Title" type="xsd:string"/>                                     </xsd:sequence>                                 </xsd:complexType>                             </xsd:element>                         </xsd:sequence>                     </xsd:complexType>                 </xsd:element>                 <xsd:element name="Title" type="xsd:string"/>             </xsd:sequence>         </xsd:complexType>     </xsd:element>     <xsd:complexType name="Title">         <xsd:sequence>              <xsd:element name="CarManufacturer" type="xsd:string"/>             <xsd:element name="Year" type="xsd:gYear"/>         </xsd:sequence>     </xsd:complexType>     <xsd:element name="Title" type="xsd:string"/>     <xsd:attribute name="Title" type="xsd:string"/> </xsd:schema>