XML Schema Definition
Dan Tobias (Talk | contribs) |
Dan Tobias (Talk | contribs) (Merged in from XML Schema Description) |
||
Line 23: | Line 23: | ||
**[http://www.w3.org/TR/xmlschema11-1/ XSD 1.1 Structures] | **[http://www.w3.org/TR/xmlschema11-1/ XSD 1.1 Structures] | ||
**[http://www.w3.org/TR/xmlschema11-2/ XSD 1.1 Datatypes] | **[http://www.w3.org/TR/xmlschema11-2/ XSD 1.1 Datatypes] | ||
+ | ==Example== | ||
+ | <pre><?xml version="1.0" encoding="UTF-8"?> | ||
+ | <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" | ||
+ | xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" | ||
+ | jaxb:extensionBindingPrefixes="xjc" | ||
+ | elementFormDefault="unqualified" | ||
+ | xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.0"> | ||
− | == | + | <xs:element name='FrostMessage'> |
+ | <xs:complexType> | ||
+ | <xs:sequence> | ||
+ | <xs:element name='MessageId' type="xs:string"> | ||
+ | </xs:element> | ||
+ | <xs:element name='InReplyTo' type="xs:string"> | ||
+ | </xs:element> | ||
+ | <xs:element name='IdLinePos' type="xs:integer"> | ||
+ | </xs:element> | ||
+ | <xs:element name='IdLineLen' type="xs:integer"> | ||
+ | </xs:element> | ||
+ | <xs:element name='From' type="xs:string"> | ||
+ | </xs:element> | ||
+ | <xs:element name='Subject' type="xs:string"> | ||
+ | </xs:element> | ||
+ | <xs:element name='Date' type="xs:string"> | ||
+ | </xs:element> | ||
+ | <xs:element name='Time' type="xs:string"> | ||
+ | </xs:element> | ||
+ | <xs:element name='Body' type="xs:string"> | ||
+ | </xs:element> | ||
+ | <xs:element name='Board' type="xs:string"> | ||
+ | </xs:element> | ||
+ | <xs:element name='PubKey' type="xs:string"> | ||
+ | </xs:element> | ||
+ | <xs:element name='Signature' type="xs:string"> | ||
+ | </xs:element> | ||
+ | <xs:element name='SignatureV2' type="xs:string"> | ||
+ | </xs:element> | ||
+ | </xs:sequence> | ||
+ | </xs:complexType> | ||
+ | </xs:element> | ||
+ | </xs:schema></pre> | ||
+ | |||
+ | == Links == | ||
* [[Wikipedia:XML Schema (W3C)|Wikipedia article]] | * [[Wikipedia:XML Schema (W3C)|Wikipedia article]] | ||
* [http://www.dmoz.org/Computers/Data_Formats/Markup_Languages/XML/Validation/XML_Schema/ Open Directory Project page] | * [http://www.dmoz.org/Computers/Data_Formats/Markup_Languages/XML/Validation/XML_Schema/ Open Directory Project page] |
Revision as of 23:41, 17 April 2015
An XML Schema Definition (XSD) is a file defining a particular set of data types and structural rules for a class of XML documents, which is itself expressed in XML form. The standard for it was adopted by the W3C (World Wide Web Consortium) in May, 2001. It was intended as a more flexible and extensible method of defining XML file format characteristics than the older method of using DTDs (Data Type Definitions), since a document can have only one DTD, but can have multiple XSDs to define namespaces used in the document.
DFDL (Data Format Definition Language) is a variety of XSD with additional annotations to specify particular (binary or text) data file formats in a file which can be of a non-XML variety, allowing arbitrary file formats to be mapped onto particular XML file formats encompassing their content and structure.
Specs
- W3C XML Schema 1.0 Specification
- W3C XML Schema 1.1 Specification
Example
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" jaxb:extensionBindingPrefixes="xjc" elementFormDefault="unqualified" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.0"> <xs:element name='FrostMessage'> <xs:complexType> <xs:sequence> <xs:element name='MessageId' type="xs:string"> </xs:element> <xs:element name='InReplyTo' type="xs:string"> </xs:element> <xs:element name='IdLinePos' type="xs:integer"> </xs:element> <xs:element name='IdLineLen' type="xs:integer"> </xs:element> <xs:element name='From' type="xs:string"> </xs:element> <xs:element name='Subject' type="xs:string"> </xs:element> <xs:element name='Date' type="xs:string"> </xs:element> <xs:element name='Time' type="xs:string"> </xs:element> <xs:element name='Body' type="xs:string"> </xs:element> <xs:element name='Board' type="xs:string"> </xs:element> <xs:element name='PubKey' type="xs:string"> </xs:element> <xs:element name='Signature' type="xs:string"> </xs:element> <xs:element name='SignatureV2' type="xs:string"> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>