Create one xml schema for different xml files

ruadulatf

New Member
How can i create one xml schema for different xml files? I have one xml scema for one xml file:XML:\[code\] <?xml version="1.0" encoding="utf-8"?><Part xsi:schemaLocation="http://tempuri.org PART.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org"> <Tube xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="OvalTube" xsi:schemaLocation="http://tempuri.org PART.xsd"> <Type>OvalTube</Type> <WallThickness>10</WallThickness> <Height>20</Height> <Width>20</Width> </Tube> <Intersection xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="PlaneIntersection" xsi:schemaLocation="http://tempuri.org PART.xsd"> <Type>PlaneIntersection</Type> <Position>Left</Position> <Cut>InnerCut</Cut> <Movement>Robot</Movement> <Burning>Cutting</Burning> </Intersection></Part>\[/code\]XSD:\[code\]<?xml version="1.0" encoding="utf-8"?><xs:schema attributeFormDefault="unqualified" targetNamespace="http://tempuri.org" xmlns="http://tempuri.org" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:complexType name="TubeType"> <xsd:sequence> <xsd:element name="Type" type="xsd:string"/> <xsd:element name="WallThickness" type="xsd:double"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="OvalTube"> <xsd:complexContent> <xsd:extension base="TubeType"> <xsd:sequence> <xsd:element name="Height" type="xsd:double"/> <xsd:element name="Width" type="xsd:double"/> </xsd:sequence> </xsd:extension> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="IntersectionType"> <xsd:sequence> <xsd:element name="Type" type="xsd:string"/> <xsd:element name="Position" type="xsd:string"/> <xsd:element name="Cut" type="xsd:string"/> <xsd:element name="Movement" type="xsd:string"/> <xsd:element name="Burning" type="xsd:string"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="PlaneIntersection"> <xsd:complexContent> <xsd:extension base="IntersectionType"> </xsd:extension> </xsd:complexContent> </xsd:complexType> <xsd:complexType name="PartType"> <xsd:sequence> <xsd:element name="Tube" type="TubeType"/> <xsd:element name="Intersection" type="IntersectionType"/> </xsd:sequence> </xsd:complexType> <xsd:element name="Part" type="PartType"/></xs:schema>\[/code\]But i have more xml files with different elements. For example:Xml:\[code\]<?xml version="1.0" encoding="utf-8"?><Part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tempuri.org PART.xsd" xmlns="http://tempuri.org"> <Tube xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="BentTube" xsi:schemaLocation="http://tempuri.org PART.xsd" xmlns="http://tempuri.org"> <Type>Benttube</Type> <WallThickness>50</WallThickness> <Width>90</Width> <Radius>45</Radius> </Tube> <Intersection xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:type="HoleIntersection" xsi:schemaLocation="http://tempuri.org PART.xsd"> <Type>HoleIntersection</Type> <Position>Left</Position> <Cut>InnerCut</Cut> <Movement>Robot</Movement> <Diameter>45</Diameter> </Intersection></Part>\[/code\]And i need one xml schema. Any idea how can i create one xml schema for different xml files?
 
Back
Top