Document Structure Description
Encyclopedia
Document Structure Description, or DSD, is a schema
XML schema
An XML schema is a description of a type of XML document, typically expressed in terms of constraints on the structure and content of documents of that type, above and beyond the basic syntactical constraints imposed by XML itself...

 language for XML
Extensible Markup Language
Extensible Markup Language is a set of rules for encoding documents in machine-readable form. It is defined in the XML 1.0 Specification produced by the W3C, and several other related specifications, all gratis open standards....

, that is, a language for describing valid XML documents. It's an alternative to DTD
Document Type Definition
Document Type Definition is a set of markup declarations that define a document type for SGML-family markup languages...

 or the W3C XML Schema.

An example of DSD in its simplest form:

<dsd xmlns="http://www.brics.dk/DSD/2.0"
xmlns:my="http://example.com">

<if><element name="my:foo"/>
<declare>
<attribute name="first"/>
<attribute name="second"/>
<contents>
<element name="my:bar"/>
</contents>
</declare>
</if>

<if><element name="my:bar"/>
<declare>
<contents>
</contents>
</declare>
</if>

</dsd>

This says that element named "foo" in the XML namespace
XML Namespace
xmlns tagged XML namespaces are used for providing uniquely named elements and attributes in an XML document. They are defined in a W3C recommendation. An XML instance may contain element or attribute names from more than one XML vocabulary...

"http://example.com" may have two attributes, named "first" and "second". A "foo" element may not have any character data. It must contain one subelement, named "bar", also in the "http://example.com" namespace. A "bar" element is not allowed any attributes, character data or subelements.

One XML document that would be valid according to the above DSD would be:

<foo xmlns="http://example.com" second="2">
<bar/>
</foo>

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK