<?xml version="1.0"?> <bookstore xmlns="generic"> <book genre="autobiography"> <title>The Autobiography of Benjamin Franklin</title> <author> <first-name>Ben</first-name> <last-name>Franklin</last-name> </author> <price>89.88</price> </book> <book genre="novel"> <title>The Confidence Man</title> <author> <first-name>John</first-name> <last-name>Melville</last-name> </author> <price>11.99</price> </book> </bookstore>
<?xml version="1.0" encoding="utf-8"?> <xs:schema id="bookstore" targetNamespace="generic" xmlns:mstns="generic" xmlns="generic" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" attributeFormDefault="qualified" elementFormDefault="qualified"> <xs:element name="bookstore" msdata:IsDataSet="true" msdata:UseCurrentLocale="true"> <xs:complexType> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="book"> <xs:complexType> <xs:sequence> <xs:element name="title" type="xs:string" minOccurs="0" msdata:Ordinal="0" /> <xs:element name="price" type="xs:string" minOccurs="0" msdata:Ordinal="2" /> <xs:element name="author" minOccurs="0" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="first-name" type="xs:string" minOccurs="0" /> <xs:element name="last-name" type="xs:string" minOccurs="0" /> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="genre" form="unqualified" type="xs:string" /> </xs:complexType> </xs:element> </xs:choice> </xs:complexType> </xs:element> </xs:schema>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="generic" elementFormDefault="qualified" targetNamespace="generic"> <xsd:element name="bookstore" type="bookstoreType"/> <xsd:complexType name="bookstoreType"> <xsd:sequence maxOccurs="unbounded"> <xsd:element name="book" type="bookType"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="bookType"> <xsd:sequence> <xsd:element name="title" type="xsd:string"/> <xsd:element name="author" type="authorName"/> <xsd:element name="price" type="xsd:decimal"/> </xsd:sequence> <xsd:attribute name="genre" type="xsd:string"/> </xsd:complexType> <xsd:complexType name="authorName"> <xsd:sequence> <xsd:element name="first-name" type="xsd:string"/> <xsd:element name="last-name" type="xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:schema>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)