- <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:dw="http://www.ibm.com/developerWorks/"
elementFormDefault="unqualified"
attributeFormDefault="unqualified" version="4.0">
- element, annotation, complexType, choice, type
- <xsd:element name="text-data" type="xsd:string" />
- restrictionn
<xsd:simpleType name="colorname">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="blue" />
<xsd:enumeration value="green" />
<xsd:enumeration value="red" />
</xsd:restriction>
</xsd:simpleType> - extentioin
<xsd:element name="title">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base=" xsd:string">
<xsd:attribute name="isbn" type="xsd:string"/>
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
- relaxer -xsd toc.xml
- install dtd2xs from [url]www.lumrix.net[/url]
- setup CLASSPAHT
- java dtd2xsd toc.dtd > toc-schema.xsd
- nonnamespaced
<dw-document xsi:noNamespaceSchemaLocation="dw-document-4.0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - namespaced
<dw-document xmlns="http://www.ibm.com/developerWorks"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.ibm.com/developerWorks
dw-document-4.0.xsd"> - Validating against a schema
xmllint --schema dw-document-4.0.xsd index.xml --noout