Text Data Description Languages

Document Type Definitions (DTDs)

Developed in SGML

See movies.dtd

Namespaces

mechanism to identify names uniquely:

See Bray's example

XML Schema

3-part specification: primer, structures, datatypes

See movies.xsd

Relax NG

ISO standard (Dec. 2003), developed by James Clark and Murata Makoto through OASIS

http://www.relaxng.org/

Two syntaxes:

XML Syntax

<grammar xmlns="http://relaxng.org/ns/structure/1.0">

<start>

<ref name="AddressBook"/>

</start>

 

<define name="AddressBook">

<zeroOrMore>

<ref name="Card"/>

</zeroOrMore>

</define>

<define name="Card">

<element name="name">

<text/>

</element>

<element name="email">

<attribute name "workOrHome">

<choice>

<value>work</value>

<value>home</value>

</choice>

</attribute>

<text/>

</element>

<optional>

<element name="note">

<text/>

</element>

</optional>

</define>

</grammar>

Compact Syntax

grammar {

start = AddressBook

AddressBook = element addressBook { Card* }

Card = element card { Name, Email, element note { text} ? }

Name = element name { text }

Email = element email { attribute workOrHome { ("work" | "home") }, text }

}

 

Relax NG specification in Relax NG

References and related reading

Querying XML, Chapter 4, 5, 7.3, 7.4

Bray98

 

 

W3C Namespaces

Bray99

 

W3C XML Schema0

W3C XML Schema1

W3C XML Schema2

Relax NG Spec

Relax NG Tutorial