Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //XML
- <?xml version="1.0" encoding="UTF-8"?>
- <sklep>
- <dzial id="1234">
- <rodzaj>spożywczy</rodzaj>
- <towar cena="3.00" ilosc="30">cukier</towar>
- <towar cena="1.50" ilosc="10">jogurt</towar>
- <towar cena="0.60" ilosc="10">pieczywo</towar>
- <towar cena="5.60" ilosc="10">kawa</towar>
- </dzial>
- <dzial id="1235">
- <rodzaj>chemiczny</rodzaj>
- <towar cena="3.00" ilosc="30">proszek do prania</towar>
- <towar cena="3.50" ilosc="10">pasta do zebow</towar>
- <towar cena="2.00" ilosc="10">wybielacz</towar>
- </dzial>
- </sklep>
- //XSD
- <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
- <xs:element name="sklep">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="dzial" maxOccurs="unbounded" minOccurs="0">
- <xs:complexType>
- <xs:sequence>
- <xs:element name="rodzaj">
- <xs:simpleType>
- <xs:restriction base="xs:string">
- <xs:enumeration value="spożywczy"/>
- <xs:enumeration value="chemiczny"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:element>
- <xs:element name="towar" maxOccurs="unbounded" minOccurs="0">
- <xs:complexType>
- <xs:simpleContent>
- <xs:extension base="xs:string">
- <xs:attribute name="cena" use="optional">
- <xs:simpleType>
- <xs:restriction base="xs:decimal">
- <xs:fractionDigits value="2"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- <xs:attribute name="ilosc" use="optional">
- <xs:simpleType>
- <xs:restriction base="xs:float">
- <xs:minInclusive value="0"/>
- </xs:restriction>
- </xs:simpleType>
- </xs:attribute>
- </xs:extension>
- </xs:simpleContent>
- </xs:complexType>
- <xs:key name="ID">
- <xs:selector xpath="sklep/dzial" />
- <xs:field xpath="@id" />
- </xs:key>
- <xs:keyref name="IDREF" refer="ID">
- <xs:selector xpath="sklep/dzial" />
- <xs:field xpath="towar" />
- </xs:keyref>
- </xs:element>
- </xs:sequence>
- <xs:attribute type="xs:short" name="id" use="optional"/>
- </xs:complexType>
- </xs:element>
- </xs:sequence>
- </xs:complexType>
- </xs:element>
- </xs:schema>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement