Finished Day 6 contents.
This chapter depicts the basic of XML Schema (.xsd file).
To define an XML Schema, we need to have the basic declaration as this,
<?xml version="1.0" encoding="utf-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
...
</xsd:schema>
The contents of <xsd:schema/> is the actual xml document definition.
The most basically, we can
- using <xsd:element name="document" ... /> to define an element.
- using <xsd:attribute name="publishing" ... /> to define an attribute.
Every element can be further define as a complex type, simple type like this.
Define element with simple type:
<xsd:element name="name" type="xsd:string" />
Define element with customised complex type:
<xsd:element name="document" type="documentType />
<xsd:complexType name="documentType">
<xsd:sequence>
<xsd:element name="title" type="xsd:string" />
<xsd:element name="author" type="xsd:string" />
<xsd:element name="publishing" type="xsd:date" />
</xsd:sequence>
</xsd:complexType>
Wednesday, January 09, 2008
Subscribe to:
Post Comments (Atom)
XML Master Cert Group
XML Master Certification |
Visit this group |
No comments:
Post a Comment