Extensible Markup Language
A syntax for documents
A Meta-Markup Language
A Structural and Semantic language, not a formatting language
Not just for Web pages
Not like HTML, troff, LaTeX
Make up the tags you need as you need them
The tags you create can be documented in a Document Type Definition (DTD)
A meta syntax for domain-specific markup languages like MusicML, MathML, and CML
<dt>Hot Cop <dd> by Jacques Morali, Henri Belolo, and Victor Willis <ul> <li>Producer: Jacques Morali <li>Publisher: PolyGram Records <li>Length: 6:20 <li>Written: 1978 <li>Artist: Village People </ul>View Document in Browser
<SONG> <TITLE>Hot Cop</TITLE> <COMPOSER>Jacques Morali</COMPOSER> <COMPOSER>Henri Belolo</COMPOSER> <COMPOSER>Victor Willis</COMPOSER> <PRODUCER>Jacques Morali</PRODUCER> <PUBLISHER>PolyGram Records</PUBLISHER> <LENGTH>6:20</LENGTH> <YEAR>1978</YEAR> <ARTIST>Village People</ARTIST> </SONG>View Document in Browser
<!ELEMENT SONG (TITLE, COMPOSER+, PRODUCER*, PUBLISHER*, LENGTH?, YEAR?, ARTIST+)> <!ELEMENT TITLE (#PCDATA)> <!ELEMENT COMPOSER (#PCDATA)> <!ELEMENT PRODUCER (#PCDATA)> <!ELEMENT PUBLISHER (#PCDATA)> <!ELEMENT LENGTH (#PCDATA)> <!-- This should be a four digit year like "1999", not a two-digit year like "99" --> <!ELEMENT YEAR (#PCDATA)> <!ELEMENT ARTIST (#PCDATA)>
<?xml version="1.0"?> <!DOCTYPE SONG SYSTEM "song.dtd"> <SONG> <TITLE>Hot Cop</TITLE> <COMPOSER>Jacques Morali</COMPOSER> <COMPOSER>Henri Belolo</COMPOSER> <COMPOSER>Victor Willis</COMPOSER> <PRODUCER>Jacques Morali</PRODUCER> <PUBLISHER>PolyGram Records</PUBLISHER> <LENGTH>6:20</LENGTH> <YEAR>1978</YEAR> <ARTIST>Village People</ARTIST> </SONG>
To be valid an XML document must be
Well-formed
Must have a DTD
Must comply with the constraints specified in the DTD
To check validity you pass the document through a validating parser which should report any errors it finds. For example,
% java dom.DOMCount validhotcop.xml [Error] validhotcop.xml:13:9: The content of element type "SONG" must match "(TI TLE,COMPOSER+,PRODUCER*,PUBLISHER*,LENGTH?,YEAR?)". validhotcop.xml: 550 ms (10 elems, 0 attrs, 28 spaces, 98 chars)
A valid document:
% java dom.DOMCount validhotcop.xml validhotcop.xml: 291 ms (10 elems, 0 attrs, 28 spaces, 98 chars)
Domain-Specific Markup Languages
Self-Describing Data
Interchange of Data Among Applications
Structured and Integrated Data
A DTD precisely describes the format
DTDs verify that documents adhere to the format
Ensures interoperability of unrelated tools
DTDs explain the format so reverse engineering isn't as necessary
Comments in DTDs can go even further
<!-- This should be a four digit year like "1999",
not a two-digit year like "99" -->
<!ELEMENT YEAR (#PCDATA)>
E-commerce and syndication
DTDs make sure that two independent applications speak the same language
DTDs detect malformed data
DTDs verify correct data
Can specify relationships between elements using element declarations
Can assemble data from multiple sources using external entity references declared in the DTD
A specific markup language that uses the XML meta-syntax is called an XML application
Different XML applications have their own more constricted syntaxes and vocabularies within the broader XML syntax
The DTD documents this syntax
Further syntax can be layered on top of this; e.g. data typing through schemas or custom code
There are two levels of conformance to XML
Well-formed documents are correct with or without a DTD. They adhere to the basic syntax rules of XML
Valid documents also adhere to the constraints specified in a DTD
All valid documents are well-formed; not all well-formed document are valid.
Open and close all tags
Empty tags end with />
There is a unique root element
Elements may not overlap
Attribute values are quoted
<
and &
are only used to start tags and entities
Only the five predefined entity references are used
Good:
<p>The quick brown fox jumped over the lazy dog</p>
<li>A very <B>important</B> point</li>
Copyright 1999 Elliotte Rusty Harold<br></br>
Bad:
The quick brown fox jumped over the lazy dog<p>
<li>A very <B>important point
Copyright 1999 Elliotte Rusty Harold<br>
<BR/>
, <HR/>
, and <IMG/>
instead of <BR>
, <HR>
, and <IMG>
Web browsers deal inconsistently with these
Can use <BR></BR>
<HR></HR>
<IMG></IMG>
instead
One element completely contains all other elements of the document
This is HTML
in HTML files
The XML declaration and xml-stylesheet
processing instruction are
not elements
If an element contains a start tag for an element, it must also contain the corresponding end tag
Empty elements may appear anywhere
Every non root element has a parent element
Good:
<A HREF="http://metalab.unc.edu/xml/">
<DIV ALIGN="CENTER">
<A HREF="http://metalab.unc.edu/xml/">
<EMBED SRC="minnesotaswale.aif" hidden="true">
Bad:
<A HREF=http://metalab.unc.edu/xml/>
<DIV ALIGN=CENTER>
<EMBED SRC=minnesotaswale.aif hidden=true>
<EMBED SRC="minnesotaswale.aif" hidden>
Good:
<H1>O'Reilly & Associates</H1>
Bad:
<H1>O'Reilly & Associates</H1>
Good:
<CODE>for (int i = 0; i <= args.length; i++ ) { </CODE>
Bad:
<CODE>for (int i = 0; i <= args.length; i++ ) { </CODE>
Good:
&
<
>
"
'
Bad:
©
®
&tm;
α
é
etc.
DTDs loosen this restriction by allowing you to define new entities, even in an invalid document.
A Document Type Definition describes the elements and attributes that may appear in a document
Validation compares a particular document against a DTD
Well-formedness is a prerequisite for validity
A DTD lists the elements, attributes, and entities contained in a document
A DTD defines the relationships between different elements and attributes
Internal vs. external DTDs
Ensures that data is correct before feeding it into a program
Ensures that a format is followed
Establishes what must be supported
Not all documents need to be valid; sometimes well-formed is enough
greeting.xml:
<?xml version="1.0"?>
<GREETING>
Hello XML!
</GREETING>
greeting.dtd:
<!ELEMENT GREETING (#PCDATA)>
<?xml version="1.0"?>
<!DOCTYPE GREETING SYSTEM "greeting.dtd">
<GREETING>
Hello XML!
</GREETING>
specifies the root element
gives a URL for the DTD
Valid:
<GREETING>
various random text but no markup
</GREETING>
Invalid: anything else including
<GREETING>
<sometag>various random text</sometag>
<someEmptyTag/>
</GREETING>
or
<GREETING>
<GREETING>various random text</GREETING>
</GREETING>
Command line programs like XJParse and dom.DOMCount
C:\speaking\SD2000West\dtds>java XJParse validhotcop.xml Fatal Error at (file file:/D:/speaking/SD99EAST/dtds/validhotcop.xml, line 2, ch ar 18): Unknown external identifier, "". "SYSTEM" or "PUBLIC" expected. validhotcop.xml: 251 ms (10 elems, 0 attrs, 0 spaces, 126 chars) C:\speaking\SD2000West\dtds>java XJParse validhotcop.xml validhotcop.xml: 111 ms (10 elems, 0 attrs, 28 spaces, 98 chars)
Online validators:
Browsers
<?xml version="1.0"?>
<!DOCTYPE GREETING [
<!ELEMENT GREETING (#PCDATA)>
]>
<GREETING>
Hello XML!
</GREETING>
<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE catalog SYSTEM "compositions.dtd"> <catalog> <category> Small chamber ensembles - 2-4 Players by New York Women Composers </category> <cataloging_info> <abstract>Compositions by the members of New York Women Composers</abstract> <keyword>music publishing</keyword> <keyword>scores</keyword> <keyword>women composers</keyword> <keyword>New York</keyword> </cataloging_info> <last_updated>July 28, 1999</last_updated> <copyright>1999 New York Women Composers</copyright> <maintainer email="elharo@metalab.unc.edu" url="http://www.macfaq.com/personal.html"> <name> <first_name>Elliotte</first_name> <middle_name>Rusty</middle_name> <last_name>Harold</last_name> </name> </maintainer> <composer id="c1"> <name> <first_name>Julie</first_name> <middle_name></middle_name> <last_name>Mandel</last_name> </name> </composer> <composer id="c2"> <name> <first_name>Margaret</first_name> <middle_name>De</middle_name> <last_name>Wys</last_name> </name> </composer> <composer id="c3"> <name> <first_name>Beth</first_name> <middle_name></middle_name> <last_name>Anderson</last_name> </name> </composer> <composer id="c4"> <name> <first_name>Linda</first_name> <middle_name></middle_name> <last_name>Bouchard</last_name> </name> </composer> <composition composer="c1"> <title>Trio for Flute, Viola and Harp</title> <date><year>1994</year></date> <length>13'38"</length> <instruments>fl, hp, vla</instruments> <description> <p>Premiered at Queens College in April, 1996 by Sue Ann Kahn, Christine Ims, and Susan Jolles. In 3 movements :</p> <ul> <li>mvt. 1: 5:01</li> <li>mvt. 2: 4:11</li> <li>mvt. 3: 4:26</li> </ul> </description> <publisher>Theodore Presser</publisher> </composition> <composition composer="c2"> <title>Charmonium</title> <date><year>1991</year></date> <length>9'</length> <instruments>2 vln, vla, vc</instruments> <description> <p>Commissioned as quartet for the Meridian String Quartet. Sonorous, bold. Moderate difficulty. Tape available.</p> </description> </composition> <composition composer="c1"> <title>Invention for Flute and Piano</title> <date><year>1994</year></date> <instruments>fl, pn</instruments> <description><p>3 movements</p></description> </composition> <composition composer="c3"> <title>Little Trio</title> <date><year>1984</year></date> <length>4'</length> <instruments>fl, guit, va</instruments> <publisher>ACA</publisher> </composition> <composition composer="c3"> <title>Dr. Blood's Mermaid Lullaby</title> <date><year>1980</year></date> <length>3'</length> <instruments>fl or ob, or vn, or vc, pn</instruments> <publisher>ACA</publisher> </composition> <composition composer="c3"> <title>Trio: Dream in D</title> <date><year>1980</year></date> <length>10'</length> <instruments>fl, pn, vc, or vn, pn, vc</instruments> <description> <p>Rhapsodic. Passionate. Available on CD <cite><a href="http://www.amazon.com/exec/obidos/ASIN/B000007NMH/qid%3D913265342/sr%3D1-2/">Two by Three</a></cite> from North/South Consonance (1998).</p> </description> </composition> <composition composer="c4"> <title>Propos II</title> <date><year>1985</year></date> <length>11'</length> <instruments>2 tpt</instruments> <description><p>Arrangement from Propos</p></description> </composition> <composition composer="c4"> <title>Rictus En Mirroir</title> <date><year>1985</year></date> <length>14'</length> <instruments>fl, ob, hpschd, vc</instruments> </composition> </catalog>View in Browser
Each tag must be declared in a <!ELEMENT>
declaration.
A <!ELEMENT>
declaration gives the
name and content model of the element
The content model uses a simple regular expression-like grammar to precisely specify what is and isn't allowed in an element
ANY
#PCDATA
Sequences
Choices
Mixed Content
Modifiers
EMPTY
<!ELEMENT catalog ANY>
A catalog
can contain any
child element and/or raw text (parsed character data)
Parsed Character Data; i.e. raw text, no markup. For example,
<year>1984</year>
<!ELEMENT year (#PCDATA)>
Valid:
<year>1999</year>
<year>99</year>
<year>1999 C.E.</year>
<year>
The year of our Lord one thousand, nine hundred, and ninety-nine
</year>
Invalid:
<year>
<month>January</month>
<month>February</month>
<month>March</month>
<month>April</month>
<month>May</month>
<month>June</month>
<month>July</month>
<month>August</month>
<month>September</month>
<month>October</month>
<month>November</month>
<month>December</month>
</year>
There are a number of elements in the example document that only contain PCDATA:
<!ELEMENT category (#PCDATA)>
<!ELEMENT abstract (#PCDATA)>
<!ELEMENT keyword (#PCDATA)>
<!ELEMENT last_updated (#PCDATA)>
<!ELEMENT copyright (#PCDATA)>
<!ELEMENT first_name (#PCDATA)>
<!ELEMENT middle_name (#PCDATA)>
<!ELEMENT last_name (#PCDATA)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT year (#PCDATA)>
<!ELEMENT instruments (#PCDATA)>
<!ELEMENT publisher (#PCDATA)>
<!ELEMENT length (#PCDATA)>
DTDs seem fundamentally more obfuscated than C.
Comments can improve this by giving example elements
Comments are the same as in HTML; e.g. <!-- Comment -->
<!-- e.g. "1999 New York Women Composers",
not "Copyright 1999 New York Women Composers" -->
<!ELEMENT copyright (#PCDATA)>
<date><year>1994</year></date>
To declare that a date
element must have a
year
child:
<!ELEMENT date (year)>
You only have to declare the immediate children
<maintainer email="elharo@metalab.unc.edu"
url="http://www.macfaq.com/personal.html">
<name>
<first_name>Elliotte</first_name>
<middle_name>Rusty</middle_name>
<last_name>Harold</last_name>
</name>
</maintainer>
<composer id="c1">
<name>
<first_name>Julie</first_name>
<middle_name></middle_name>
<last_name>Mandel</last_name>
</name>
</composer>
To declare that an element must have exactly one
name
child:
<!ELEMENT maintainer (name)>
<!ELEMENT composer (name)>
<name>
<first_name>Elliotte</first_name>
<middle_name>Rusty</middle_name>
<last_name>Harold</last_name>
</name>
Separate multiple required child elements with commas; e.g.
<!ELEMENT name (first_name, middle_name, last_name)>
A list of child elements separated by commas is called a sequence
ELEMENT
The element being described must have only child elements, no mixed content
You must know the order of the child elements
You must know the type of each child element
You must know the number of child elements
The number can be relaxed with wild cards
<cataloging_info>
<abstract>Compositions by the members of New York Women Composers</abstract>
<keyword>music publishing</keyword>
<keyword>scores</keyword>
<keyword>women composers</keyword>
<keyword>New York</keyword>
</cataloging_info>
The +
suffix indicates that one or more of that element
is required at that point
<!ELEMENT cataloging_info (abstract, keyword+)>
The *
suffix indicates that zero, one, or more of that element
is required at that point
<!ELEMENT catalog (category, cataloging_info, last_updated, copyright,
maintainer, composer*, composition*)>
<composition composer="c1">
<title>Trio for Flute, Viola and Harp</title>
<date><year>(1994)</year></date>
<length>13'38"</length>
<instruments>fl, hp, vla</instruments>
<description>
<p>Premiered at Queens College in April, 1996 by Sue Ann Kahn,
Christine Ims, and Susan Jolles. In 3 movements :</p>
<ul>
<li>mvt. 1: 5:01</li>
<li>mvt. 2: 4:11</li>
<li>mvt. 3: 4:26</li>
</ul>
</description>
<publisher>Theodore Presser</publisher>
</composition>
Suffixing an element name with a question mark (?) in the content model indicates that either 0 or 1 (but not more than one) of that element are expected at that position
<!ELEMENT composition
(title, date, length?, instruments, description?, publisher?)>
A choice indicates one element or another but not both
A choice is signified by a vertical bar |
There can be two or more elements in a choice
<!ELEMENT date (year | ISODate)>
<!ELEMENT year (#PCDATA)>
<!ELEMENT ISODate (#PCDATA)>
Parentheses combine several elements into a single element.
Parenthesized elements can be nested inside other parentheses in place of a single element.
The parenthesized elements can be suffixed with a plus sign, a comma, or a question mark.
<!ELEMENT dl (dt, dd)*>
<!ELEMENT ARTICLE
(TITLE,
(P | PHOTO | GRAPH | SIDEBAR | PULLQUOTE | SUBHEAD)*,
BYLINE?)>
<ELEMENT catalog (category, cataloging_info, last_updated,
copyright, maintainer, (composer | composition)*)>
<!ELEMENT description (#PCDATA | ul | a | cite | p)*>
<!ELEMENT cite (#PCDATA | a)*>
<!ELEMENT ul (li)*>
<!ELEMENT li (#PCDATA)>
<!ELEMENT a (#PCDATA)>
<!ELEMENT p (#PCDATA)>
Mixed content is both #PCDATA and child elements in a choice, followed by an asterisk
Should be avoided where possible
This is the only way to combine PCDATA with child elements in a content model
#PCDATA must come first
#PCDATA cannot be used in a sequence
This completes element declarations
<!ELEMENT BR EMPTY>
<!ELEMENT IMG EMPTY>
<!ELEMENT HR EMPTY>
Mixed content with other content models
Exactly one element of a given type but in any position (The SGML & operator)
Between M and N of a given element
Restrictions on the PCDATA; e.g. that the year
element must contain a four-digit year
Recall this element:
<maintainer email="elharo@metalab.unc.edu"
url="http://www.macfaq.com/personal.html">
<name>
<first_name>Elliotte</first_name>
<middle_name>Rusty</middle_name>
<last_name>Harold</last_name>
</name>
</maintainer>
It is declared like this:
<!ELEMENT maintainer (name)>
<!ATTLIST maintainer email CDATA "webmaster@nywc.org">
<!ATTLIST maintainer url CDATA "http://metalab.unc.edu/nywc">
The general format of an <!ATTLIST>
declaration is:
<!ATTLIST Element_name Attribute_name Type Default_value>
<maintainer email="elharo@metalab.unc.edu"
url="http://www.macfaq.com/personal.html">
<name>
<first_name>Elliotte</first_name>
<middle_name>Rusty</middle_name>
<last_name>Harold</last_name>
</name>
</maintainer>
It is declared like this:
<!ELEMENT maintainer (name)>
<!ATTLIST maintainer email CDATA "webmaster@nywc.org">
<!ATTLIST maintainer url CDATA "http://metalab.unc.edu/nywc">
But it can also be declared in a single
<!ATTLIST>
declaration like this:
<!ATTLIST maintainer email
CDATA "webmaster@nywc.org" url CDATA "http://metalab.unc.edu/nywc/">
This is more obvious with better indentation:
<!ATTLIST maintainer email CDATA "webmaster@nywc.org"
url CDATA "http://metalab.unc.edu/nywc/">
A literal string value
One of these three keywords
#REQUIRED
#IMPLIED
#FIXED
No default value is provided in the DTD
Document authors must provide an attribute value for each element
<!ELEMENT maintainer (name)>
<!ATTLIST maintainer email CDATA #REQUIRED
url CDATA #REQUIRED>
<!ELEMENT a (#PCDATA)>
<!ATTLIST a href CDATA #IMPLIED>
No default value in the DTD
Author may (but does not have to) provide a value with each element
Value is the same for all elements
Default value must be provided in DTD
Document author may not change default value
<!ELEMENT maintainer (name)>
<!ATTLIST maintainer email CDATA #FIXED "webmaster@nywc.org""
url CDATA #REQUIRED>
CDATA
ID
IDREF
IDREFS
ENTITY
ENTITIES
NOTATION
NMTOKEN
NMTOKENS
Enumerated
Most general attribute type
Value can be any string of text not containing an unescaped less-than
sign (<
) or quotation marks ("
)
<!ATTLIST maintainer email CDATA #REQUIRED
url CDATA #IMPLIED>
Value must be an XML name
May include letters, digits, underscores, hyphens, and periods
May not include whitespace
May or may not have the name "id" or "ID"
May contain colons only if used for namespaces
Value must be unique within ID type attributes in the document
Generally the default value is #REQUIRED
<!ELEMENT composer (name)>
<!ATTLIST composer id ID #REQUIRED>
Value matches the ID of an element in the same document
Used for links and the like
Multiple elements may share the same IDREF values
<!ELEMENT composition (title, date, length?,
instruments, description?, publisher?)>
<!ATTLIST composition composer IDREF #REQUIRED>
A list of ID values in the same document
Separated by white space
<!ELEMENT composition (title, date, length?,
instruments, description?, publisher?)>
<!ATTLIST composition composer IDREFS #REQUIRED>
<!ELEMENT category (#PCDATA)>
<!ELEMENT abstract (#PCDATA)>
<!ELEMENT keyword (#PCDATA)>
<!ELEMENT last_updated (#PCDATA)>
<!ELEMENT copyright (#PCDATA)>
<!ELEMENT title (#PCDATA)>
<!ELEMENT instruments (#PCDATA)>
<!ELEMENT publisher (#PCDATA)>
<!ELEMENT length (#PCDATA)>
<!ELEMENT date (year | ISODate)>
<!ELEMENT year (#PCDATA)>
<!ELEMENT ISODate (#PCDATA)>
<!ELEMENT catalog (category, cataloging_info, last_updated,
copyright, maintainer, (composer | composition)*)>
<!ELEMENT cataloging_info (abstract, keyword+)>
<!ELEMENT description (#PCDATA | ul | a | cite | p)*>
<!ELEMENT cite (#PCDATA | a)*>
<!ELEMENT ul (li*)>
<!ELEMENT li (#PCDATA)>
<!ELEMENT a (#PCDATA)>
<!ELEMENT p (#PCDATA)>
<!ELEMENT maintainer (name)>
<!ELEMENT name (first_name, middle_name, last_name)>
<!ELEMENT first_name (#PCDATA)>
<!ELEMENT middle_name (#PCDATA)>
<!ELEMENT last_name (#PCDATA)>
<!ATTLIST maintainer email CDATA #REQUIRED
url CDATA #IMPLIED>
<!ELEMENT composer (name)>
<!ATTLIST composer id ID #REQUIRED>
<!ELEMENT composition (title, date, length?, instruments, description?, publisher?)>
<!ATTLIST composition composer IDREFS #REQUIRED>
<!ATTLIST a href CDATA #REQUIRED>
Value is the name of an unparsed general entity declared in the DTD
Value is a list of unparsed general entities declared in the DTD
Separated by white space
Value is the name of a notation declared in the DTD
Value is any legal XML name token
A name token is any string of text made of legal XML name characters
Legal XML name characters include letters, digits, ideographs and the underscore, hyphen, colon, and period
Name tokens differ from names in that they may start with a digit, hyphen, or period. XML names cannot.
Value is a list of XML name tokens
Separated by white space
Not a keyword
Refers to a list of possible values from which one must be chosen
Default value is generally provided explicitly
<!ATTLIST P VISIBLE (TRUE | FALSE) "TRUE">
<description>
<p>Premiered at Queens College in April, 1996 by Sue Ann Kahn,
Christine Ims, and Susan Jolles. In 3 movements :</p>
<ul>
<li>mvt. 1: 5:01</li>
<li>mvt. 2: 4:11</li>
<li>mvt. 3: 4:26</li>
</ul>
</description>
<!ELEMENT description (#PCDATA | ul | a | cite | p)*>
<!ELEMENT cite (#PCDATA | a)*>
<!ELEMENT ul (li*)>
<!ELEMENT li (#PCDATA)>
<!ELEMENT p (#PCDATA)>
<!ELEMENT a (#PCDATA)>
<!ATTLIST a href CDATA #IMPLIED>
XHTML is a reformulation of HTML as strict XML
Tags must be closed
Attribute values must be quoted
<br/>
instead of <br>
etc.
W3C Recommendation 26 January 2000
Includes three DTDs for HTML:
Strict
Transitional
Frameset
What if we can use one of those DTDs instead of inventing our own?
<!--
Extensible HTML version 1.0 Strict DTD
This is the same as HTML 4.0 Strict except for
changes due to the differences between XML and SGML.
Namespace = http://www.w3.org/1999/xhtml
For further information, see: http://www.w3.org/TR/xhtml1
Copyright (c) 1998-2000 W3C (MIT, INRIA, Keio),
All Rights Reserved.
This DTD module is identified by the PUBLIC and SYSTEM identifiers:
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
$Revision: 1.1 $
$Date: 2000/01/26 14:08:56 $
-->
<!--================ Character mnemonic entities =========================-->
<!ENTITY % HTMLlat1 PUBLIC
"-//W3C//ENTITIES Latin 1 for XHTML//EN"
"xhtml-lat1.ent">
%HTMLlat1;
<!ENTITY % HTMLsymbol PUBLIC
"-//W3C//ENTITIES Symbols for XHTML//EN"
"xhtml-symbol.ent">
%HTMLsymbol;
<!ENTITY % HTMLspecial PUBLIC
"-//W3C//ENTITIES Special for XHTML//EN"
"xhtml-special.ent">
%HTMLspecial;
<!--================== Imported Names ====================================-->
<!ENTITY % ContentType "CDATA">
<!-- media type, as per [RFC2045] -->
<!ENTITY % ContentTypes "CDATA">
<!-- comma-separated list of media types, as per [RFC2045] -->
<!ENTITY % Charset "CDATA">
<!-- a character encoding, as per [RFC2045] -->
<!ENTITY % Charsets "CDATA">
<!-- a space separated list of character encodings, as per [RFC2045] -->
<!ENTITY % LanguageCode "NMTOKEN">
<!-- a language code, as per [RFC1766] -->
<!ENTITY % Character "CDATA">
<!-- a single character from [ISO10646] -->
<!ENTITY % Number "CDATA">
<!-- one or more digits -->
<!ENTITY % LinkTypes "CDATA">
<!-- space-separated list of link types -->
<!ENTITY % MediaDesc "CDATA">
<!-- single or comma-separated list of media descriptors -->
<!ENTITY % URI "CDATA">
<!-- a Uniform Resource Identifier, see [RFC2396] -->
<!ENTITY % UriList "CDATA">
<!-- a space separated list of Uniform Resource Identifiers -->
<!ENTITY % Datetime "CDATA">
<!-- date and time information. ISO date format -->
<!ENTITY % Script "CDATA">
<!-- script expression -->
<!ENTITY % StyleSheet "CDATA">
<!-- style sheet data -->
<!ENTITY % Text "CDATA">
<!-- used for titles etc. -->
<!ENTITY % FrameTarget "NMTOKEN">
<!-- render in this frame -->
<!ENTITY % Length "CDATA">
<!-- nn for pixels or nn% for percentage length -->
<!ENTITY % MultiLength "CDATA">
<!-- pixel, percentage, or relative -->
<!ENTITY % MultiLengths "CDATA">
<!-- comma-separated list of MultiLength -->
<!ENTITY % Pixels "CDATA">
<!-- integer representing length in pixels -->
<!-- these are used for image maps -->
<!ENTITY % Shape "(rect|circle|poly|default)">
<!ENTITY % Coords "CDATA">
<!-- comma separated list of lengths -->
<!--=================== Generic Attributes ===============================-->
<!-- core attributes common to most elements
id document-wide unique id
class space separated list of classes
style associated style info
title advisory title/amplification
-->
<!ENTITY % coreattrs
"id ID #IMPLIED
class CDATA #IMPLIED
style %StyleSheet; #IMPLIED
title %Text; #IMPLIED"
>
<!-- internationalization attributes
lang language code (backwards compatible)
xml:lang language code (as per XML 1.0 spec)
dir direction for weak/neutral text
-->
<!ENTITY % i18n
"lang %LanguageCode; #IMPLIED
xml:lang %LanguageCode; #IMPLIED
dir (ltr|rtl) #IMPLIED"
>
<!-- attributes for common UI events
onclick a pointer button was clicked
ondblclick a pointer button was double clicked
onmousedown a pointer button was pressed down
onmouseup a pointer button was released
onmousemove a pointer was moved onto the element
onmouseout a pointer was moved away from the element
onkeypress a key was pressed and released
onkeydown a key was pressed down
onkeyup a key was released
-->
<!ENTITY % events
"onclick %Script; #IMPLIED
ondblclick %Script; #IMPLIED
onmousedown %Script; #IMPLIED
onmouseup %Script; #IMPLIED
onmouseover %Script; #IMPLIED
onmousemove %Script; #IMPLIED
onmouseout %Script; #IMPLIED
onkeypress %Script; #IMPLIED
onkeydown %Script; #IMPLIED
onkeyup %Script; #IMPLIED"
>
<!-- attributes for elements that can get the focus
accesskey accessibility key character
tabindex position in tabbing order
onfocus the element got the focus
onblur the element lost the focus
-->
<!ENTITY % focus
"accesskey %Character; #IMPLIED
tabindex %Number; #IMPLIED
onfocus %Script; #IMPLIED
onblur %Script; #IMPLIED"
>
<!ENTITY % attrs "%coreattrs; %i18n; %events;">
<!--=================== Text Elements ====================================-->
<!ENTITY % special
"br | span | bdo | object | img | map">
<!ENTITY % fontstyle "tt | i | b | big | small">
<!ENTITY % phrase "em | strong | dfn | code | q | sub | sup |
samp | kbd | var | cite | abbr | acronym">
<!ENTITY % inline.forms "input | select | textarea | label | button">
<!-- these can occur at block or inline level -->
<!ENTITY % misc "ins | del | script | noscript">
<!ENTITY % inline "a | %special; | %fontstyle; | %phrase; | %inline.forms;">
<!-- %Inline; covers inline or "text-level" elements -->
<!ENTITY % Inline "(#PCDATA | %inline; | %misc;)*">
<!--================== Block level elements ==============================-->
<!ENTITY % heading "h1|h2|h3|h4|h5|h6">
<!ENTITY % lists "ul | ol | dl">
<!ENTITY % blocktext "pre | hr | blockquote | address">
<!ENTITY % block
"p | %heading; | div | %lists; | %blocktext; | fieldset | table">
<!ENTITY % Block "(%block; | form | %misc;)*">
<!-- %Flow; mixes Block and Inline and is used for list items etc. -->
<!ENTITY % Flow "(#PCDATA | %block; | form | %inline; | %misc;)*">
<!--================== Content models for exclusions =====================-->
<!-- a elements use %Inline; excluding a -->
<!ENTITY % a.content
"(#PCDATA | %special; | %fontstyle; | %phrase; | %inline.forms; | %misc;)*">
<!-- pre uses %Inline excluding img, object, big, small, sup or sup -->
<!ENTITY % pre.content
"(#PCDATA | a | br | span | bdo | map | tt | i | b |
%phrase; | %inline.forms;)*">
<!-- form uses %Block; excluding form -->
<!ENTITY % form.content "(%block; | %misc;)*">
<!-- button uses %Flow; but excludes a, form and form controls -->
<!ENTITY % button.content
"(#PCDATA | p | %heading; | div | %lists; | %blocktext; |
table | %special; | %fontstyle; | %phrase; | %misc;)*">
<!--================ Document Structure ==================================-->
<!-- the namespace URI designates the document profile -->
<!ELEMENT html (head, body)>
<!ATTLIST html
%i18n;
xmlns %URI; #FIXED 'http://www.w3.org/1999/xhtml'
>
<!--================ Document Head =======================================-->
<!ENTITY % head.misc "(script|style|meta|link|object)*">
<!-- content model is %head.misc; combined with a single
title and an optional base element in any order -->
<!ELEMENT head (%head.misc;,
((title, %head.misc;, (base, %head.misc;)?) |
(base, %head.misc;, (title, %head.misc;))))>
<!ATTLIST head
%i18n;
profile %URI; #IMPLIED
>
<!-- The title element is not considered part of the flow of text.
It should be displayed, for example as the page header or
window title. Exactly one title is required per document.
-->
<!ELEMENT title (#PCDATA)>
<!ATTLIST title %i18n;>
<!-- document base URI -->
<!ELEMENT base EMPTY>
<!ATTLIST base
href %URI; #IMPLIED
>
<!-- generic metainformation -->
<!ELEMENT meta EMPTY>
<!ATTLIST meta
%i18n;
http-equiv CDATA #IMPLIED
name CDATA #IMPLIED
content CDATA #REQUIRED
scheme CDATA #IMPLIED
>
<!--
Relationship values can be used in principle:
a) for document specific toolbars/menus when used
with the link element in document head e.g.
start, contents, previous, next, index, end, help
b) to link to a separate style sheet (rel="stylesheet")
c) to make a link to a script (rel="script")
d) by stylesheets to control how collections of
html nodes are rendered into printed documents
e) to make a link to a printable version of this document
e.g. a PostScript or PDF version (rel="alternate" media="print")
-->
<!ELEMENT link EMPTY>
<!ATTLIST link
%attrs;
charset %Charset; #IMPLIED
href %URI; #IMPLIED
hreflang %LanguageCode; #IMPLIED
type %ContentType; #IMPLIED
rel %LinkTypes; #IMPLIED
rev %LinkTypes; #IMPLIED
media %MediaDesc; #IMPLIED
>
<!-- style info, which may include CDATA sections -->
<!ELEMENT style (#PCDATA)>
<!ATTLIST style
%i18n;
type %ContentType; #REQUIRED
media %MediaDesc; #IMPLIED
title %Text; #IMPLIED
xml:space (preserve) #FIXED 'preserve'
>
<!-- script statements, which may include CDATA sections -->
<!ELEMENT script (#PCDATA)>
<!ATTLIST script
charset %Charset; #IMPLIED
type %ContentType; #REQUIRED
src %URI; #IMPLIED
defer (defer) #IMPLIED
xml:space (preserve) #FIXED 'preserve'
>
<!-- alternate content container for non script-based rendering -->
<!ELEMENT noscript %Block;>
<!ATTLIST noscript
%attrs;
>
<!--=================== Document Body ====================================-->
<!ELEMENT body %Block;>
<!ATTLIST body
%attrs;
onload %Script; #IMPLIED
onunload %Script; #IMPLIED
>
<!ELEMENT div %Flow;> <!-- generic language/style container -->
<!ATTLIST div
%attrs;
>
<!--=================== Paragraphs =======================================-->
<!ELEMENT p %Inline;>
<!ATTLIST p
%attrs;
>
<!--=================== Headings =========================================-->
<!--
There are six levels of headings from h1 (the most important)
to h6 (the least important).
-->
<!ELEMENT h1 %Inline;>
<!ATTLIST h1
%attrs;
>
<!ELEMENT h2 %Inline;>
<!ATTLIST h2
%attrs;
>
<!ELEMENT h3 %Inline;>
<!ATTLIST h3
%attrs;
>
<!ELEMENT h4 %Inline;>
<!ATTLIST h4
%attrs;
>
<!ELEMENT h5 %Inline;>
<!ATTLIST h5
%attrs;
>
<!ELEMENT h6 %Inline;>
<!ATTLIST h6
%attrs;
>
<!--=================== Lists ============================================-->
<!-- Unordered list -->
<!ELEMENT ul (li)+>
<!ATTLIST ul
%attrs;
>
<!-- Ordered (numbered) list -->
<!ELEMENT ol (li)+>
<!ATTLIST ol
%attrs;
>
<!-- list item -->
<!ELEMENT li %Flow;>
<!ATTLIST li
%attrs;
>
<!-- definition lists - dt for term, dd for its definition -->
<!ELEMENT dl (dt|dd)+>
<!ATTLIST dl
%attrs;
>
<!ELEMENT dt %Inline;>
<!ATTLIST dt
%attrs;
>
<!ELEMENT dd %Flow;>
<!ATTLIST dd
%attrs;
>
<!--=================== Address ==========================================-->
<!-- information on author -->
<!ELEMENT address %Inline;>
<!ATTLIST address
%attrs;
>
<!--=================== Horizontal Rule ==================================-->
<!ELEMENT hr EMPTY>
<!ATTLIST hr
%attrs;
>
<!--=================== Preformatted Text ================================-->
<!-- content is %Inline; excluding "img|object|big|small|sub|sup" -->
<!ELEMENT pre %pre.content;>
<!ATTLIST pre
%attrs;
xml:space (preserve) #FIXED 'preserve'
>
<!--=================== Block-like Quotes ================================-->
<!ELEMENT blockquote %Block;>
<!ATTLIST blockquote
%attrs;
cite %URI; #IMPLIED
>
<!--=================== Inserted/Deleted Text ============================-->
<!--
ins/del are allowed in block and inline content, but its
inappropriate to include block content within an ins element
occurring in inline content.
-->
<!ELEMENT ins %Flow;>
<!ATTLIST ins
%attrs;
cite %URI; #IMPLIED
datetime %Datetime; #IMPLIED
>
<!ELEMENT del %Flow;>
<!ATTLIST del
%attrs;
cite %URI; #IMPLIED
datetime %Datetime; #IMPLIED
>
<!--================== The Anchor Element ================================-->
<!-- content is %Inline; except that anchors shouldn't be nested -->
<!ELEMENT a %a.content;>
<!ATTLIST a
%attrs;
charset %Charset; #IMPLIED
type %ContentType; #IMPLIED
name NMTOKEN #IMPLIED
href %URI; #IMPLIED
hreflang %LanguageCode; #IMPLIED
rel %LinkTypes; #IMPLIED
rev %LinkTypes; #IMPLIED
accesskey %Character; #IMPLIED
shape %Shape; "rect"
coords %Coords; #IMPLIED
tabindex %Number; #IMPLIED
onfocus %Script; #IMPLIED
onblur %Script; #IMPLIED
>
<!--===================== Inline Elements ================================-->
<!ELEMENT span %Inline;> <!-- generic language/style container -->
<!ATTLIST span
%attrs;
>
<!ELEMENT bdo %Inline;> <!-- I18N BiDi over-ride -->
<!ATTLIST bdo
%coreattrs;
%events;
lang %LanguageCode; #IMPLIED
xml:lang %LanguageCode; #IMPLIED
dir (ltr|rtl) #REQUIRED
>
<!ELEMENT br EMPTY> <!-- forced line break -->
<!ATTLIST br
%coreattrs;
>
<!ELEMENT em %Inline;> <!-- emphasis -->
<!ATTLIST em %attrs;>
<!ELEMENT strong %Inline;> <!-- strong emphasis -->
<!ATTLIST strong %attrs;>
<!ELEMENT dfn %Inline;> <!-- definitional -->
<!ATTLIST dfn %attrs;>
<!ELEMENT code %Inline;> <!-- program code -->
<!ATTLIST code %attrs;>
<!ELEMENT samp %Inline;> <!-- sample -->
<!ATTLIST samp %attrs;>
<!ELEMENT kbd %Inline;> <!-- something user would type -->
<!ATTLIST kbd %attrs;>
<!ELEMENT var %Inline;> <!-- variable -->
<!ATTLIST var %attrs;>
<!ELEMENT cite %Inline;> <!-- citation -->
<!ATTLIST cite %attrs;>
<!ELEMENT abbr %Inline;> <!-- abbreviation -->
<!ATTLIST abbr %attrs;>
<!ELEMENT acronym %Inline;> <!-- acronym -->
<!ATTLIST acronym %attrs;>
<!ELEMENT q %Inline;> <!-- inlined quote -->
<!ATTLIST q
%attrs;
cite %URI; #IMPLIED
>
<!ELEMENT sub %Inline;> <!-- subscript -->
<!ATTLIST sub %attrs;>
<!ELEMENT sup %Inline;> <!-- superscript -->
<!ATTLIST sup %attrs;>
<!ELEMENT tt %Inline;> <!-- fixed pitch font -->
<!ATTLIST tt %attrs;>
<!ELEMENT i %Inline;> <!-- italic font -->
<!ATTLIST i %attrs;>
<!ELEMENT b %Inline;> <!-- bold font -->
<!ATTLIST b %attrs;>
<!ELEMENT big %Inline;> <!-- bigger font -->
<!ATTLIST big %attrs;>
<!ELEMENT small %Inline;> <!-- smaller font -->
<!ATTLIST small %attrs;>
<!--==================== Object ======================================-->
<!--
object is used to embed objects as part of HTML pages.
param elements should precede other content. Parameters
can also be expressed as attribute/value pairs on the
object element itself when brevity is desired.
-->
<!ELEMENT object (#PCDATA | param | %block; | form | %inline; | %misc;)*>
<!ATTLIST object
%attrs;
declare (declare) #IMPLIED
classid %URI; #IMPLIED
codebase %URI; #IMPLIED
data %URI; #IMPLIED
type %ContentType; #IMPLIED
codetype %ContentType; #IMPLIED
archive %UriList; #IMPLIED
standby %Text; #IMPLIED
height %Length; #IMPLIED
width %Length; #IMPLIED
usemap %URI; #IMPLIED
name NMTOKEN #IMPLIED
tabindex %Number; #IMPLIED
>
<!--
param is used to supply a named property value.
In XML it would seem natural to follow RDF and support an
abbreviated syntax where the param elements are replaced
by attribute value pairs on the object start tag.
-->
<!ELEMENT param EMPTY>
<!ATTLIST param
id ID #IMPLIED
name CDATA #IMPLIED
value CDATA #IMPLIED
valuetype (data|ref|object) "data"
type %ContentType; #IMPLIED
>
<!--=================== Images ===========================================-->
<!--
To avoid accessibility problems for people who aren't
able to see the image, you should provide a text
description using the alt and longdesc attributes.
In addition, avoid the use of server-side image maps.
Note that in this DTD there is no name attribute. That
is only available in the transitional and frameset DTD.
-->
<!ELEMENT img EMPTY>
<!ATTLIST img
%attrs;
src %URI; #REQUIRED
alt %Text; #REQUIRED
longdesc %URI; #IMPLIED
height %Length; #IMPLIED
width %Length; #IMPLIED
usemap %URI; #IMPLIED
ismap (ismap) #IMPLIED
>
<!-- usemap points to a map element which may be in this document
or an external document, although the latter is not widely supported -->
<!--================== Client-side image maps ============================-->
<!-- These can be placed in the same document or grouped in a
separate document although this isn't yet widely supported -->
<!ELEMENT map ((%block; | form | %misc;)+ | area+)>
<!ATTLIST map
%i18n;
%events;
id ID #REQUIRED
class CDATA #IMPLIED
style %StyleSheet; #IMPLIED
title %Text; #IMPLIED
name NMTOKEN #IMPLIED
>
<!ELEMENT area EMPTY>
<!ATTLIST area
%attrs;
shape %Shape; "rect"
coords %Coords; #IMPLIED
href %URI; #IMPLIED
nohref (nohref) #IMPLIED
alt %Text; #REQUIRED
tabindex %Number; #IMPLIED
accesskey %Character; #IMPLIED
onfocus %Script; #IMPLIED
onblur %Script; #IMPLIED
>
<!--================ Forms ===============================================-->
<!ELEMENT form %form.content;> <!-- forms shouldn't be nested -->
<!ATTLIST form
%attrs;
action %URI; #REQUIRED
method (get|post) "get"
enctype %ContentType; "application/x-www-form-urlencoded"
onsubmit %Script; #IMPLIED
onreset %Script; #IMPLIED
accept %ContentTypes; #IMPLIED
accept-charset %Charsets; #IMPLIED
>
<!--
Each label must not contain more than ONE field
Label elements shouldn't be nested.
-->
<!ELEMENT label %Inline;>
<!ATTLIST label
%attrs;
for IDREF #IMPLIED
accesskey %Character; #IMPLIED
onfocus %Script; #IMPLIED
onblur %Script; #IMPLIED
>
<!ENTITY % InputType
"(text | password | checkbox |
radio | submit | reset |
file | hidden | image | button)"
>
<!-- the name attribute is required for all but submit & reset -->
<!ELEMENT input EMPTY> <!-- form control -->
<!ATTLIST input
%attrs;
type %InputType; "text"
name CDATA #IMPLIED
value CDATA #IMPLIED
checked (checked) #IMPLIED
disabled (disabled) #IMPLIED
readonly (readonly) #IMPLIED
size CDATA #IMPLIED
maxlength %Number; #IMPLIED
src %URI; #IMPLIED
alt CDATA #IMPLIED
usemap %URI; #IMPLIED
tabindex %Number; #IMPLIED
accesskey %Character; #IMPLIED
onfocus %Script; #IMPLIED
onblur %Script; #IMPLIED
onselect %Script; #IMPLIED
onchange %Script; #IMPLIED
accept %ContentTypes; #IMPLIED
>
<!ELEMENT select (optgroup|option)+> <!-- option selector -->
<!ATTLIST select
%attrs;
name CDATA #IMPLIED
size %Number; #IMPLIED
multiple (multiple) #IMPLIED
disabled (disabled) #IMPLIED
tabindex %Number; #IMPLIED
onfocus %Script; #IMPLIED
onblur %Script; #IMPLIED
onchange %Script; #IMPLIED
>
<!ELEMENT optgroup (option)+> <!-- option group -->
<!ATTLIST optgroup
%attrs;
disabled (disabled) #IMPLIED
label %Text; #REQUIRED
>
<!ELEMENT option (#PCDATA)> <!-- selectable choice -->
<!ATTLIST option
%attrs;
selected (selected) #IMPLIED
disabled (disabled) #IMPLIED
label %Text; #IMPLIED
value CDATA #IMPLIED
>
<!ELEMENT textarea (#PCDATA)> <!-- multi-line text field -->
<!ATTLIST textarea
%attrs;
name CDATA #IMPLIED
rows %Number; #REQUIRED
cols %Number; #REQUIRED
disabled (disabled) #IMPLIED
readonly (readonly) #IMPLIED
tabindex %Number; #IMPLIED
accesskey %Character; #IMPLIED
onfocus %Script; #IMPLIED
onblur %Script; #IMPLIED
onselect %Script; #IMPLIED
onchange %Script; #IMPLIED
>
<!--
The fieldset element is used to group form fields.
Only one legend element should occur in the content
and if present should only be preceded by whitespace.
-->
<!ELEMENT fieldset (#PCDATA | legend | %block; | form | %inline; | %misc;)*>
<!ATTLIST fieldset
%attrs;
>
<!ELEMENT legend %Inline;> <!-- fieldset label -->
<!ATTLIST legend
%attrs;
accesskey %Character; #IMPLIED
>
<!--
Content is %Flow; excluding a, form and form controls
-->
<!ELEMENT button %button.content;> <!-- push button -->
<!ATTLIST button
%attrs;
name CDATA #IMPLIED
value CDATA #IMPLIED
type (button|submit|reset) "submit"
disabled (disabled) #IMPLIED
tabindex %Number; #IMPLIED
accesskey %Character; #IMPLIED
onfocus %Script; #IMPLIED
onblur %Script; #IMPLIED
>
<!--======================= Tables =======================================-->
<!-- Derived from IETF HTML table standard, see [RFC1942] -->
<!--
The border attribute sets the thickness of the frame around the
table. The default units are screen pixels.
The frame attribute specifies which parts of the frame around
the table should be rendered. The values are not the same as
CALS to avoid a name clash with the valign attribute.
-->
<!ENTITY % TFrame "(void|above|below|hsides|lhs|rhs|vsides|box|border)">
<!--
The rules attribute defines which rules to draw between cells:
If rules is absent then assume:
"none" if border is absent or border="0" otherwise "all"
-->
<!ENTITY % TRules "(none | groups | rows | cols | all)">
<!-- horizontal placement of table relative to document -->
<!ENTITY % TAlign "(left|center|right)">
<!-- horizontal alignment attributes for cell contents
char alignment char, e.g. char=':'
charoff offset for alignment char
-->
<!ENTITY % cellhalign
"align (left|center|right|justify|char) #IMPLIED
char %Character; #IMPLIED
charoff %Length; #IMPLIED"
>
<!-- vertical alignment attributes for cell contents -->
<!ENTITY % cellvalign
"valign (top|middle|bottom|baseline) #IMPLIED"
>
<!ELEMENT table
(caption?, (col*|colgroup*), thead?, tfoot?, (tbody+|tr+))>
<!ELEMENT caption %Inline;>
<!ELEMENT thead (tr)+>
<!ELEMENT tfoot (tr)+>
<!ELEMENT tbody (tr)+>
<!ELEMENT colgroup (col)*>
<!ELEMENT col EMPTY>
<!ELEMENT tr (th|td)+>
<!ELEMENT th %Flow;>
<!ELEMENT td %Flow;>
<!ATTLIST table
%attrs;
summary %Text; #IMPLIED
width %Length; #IMPLIED
border %Pixels; #IMPLIED
frame %TFrame; #IMPLIED
rules %TRules; #IMPLIED
cellspacing %Length; #IMPLIED
cellpadding %Length; #IMPLIED
>
<!ENTITY % CAlign "(top|bottom|left|right)">
<!ATTLIST caption
%attrs;
>
<!--
colgroup groups a set of col elements. It allows you to group
several semantically related columns together.
-->
<!ATTLIST colgroup
%attrs;
span %Number; "1"
width %MultiLength; #IMPLIED
%cellhalign;
%cellvalign;
>
<!--
col elements define the alignment properties for cells in
one or more columns.
The width attribute specifies the width of the columns, e.g.
width=64 width in screen pixels
width=0.5* relative width of 0.5
The span attribute causes the attributes of one
col element to apply to more than one column.
-->
<!ATTLIST col
%attrs;
span %Number; "1"
width %MultiLength; #IMPLIED
%cellhalign;
%cellvalign;
>
<!--
Use thead to duplicate headers when breaking table
across page boundaries, or for static headers when
tbody sections are rendered in scrolling panel.
Use tfoot to duplicate footers when breaking table
across page boundaries, or for static footers when
tbody sections are rendered in scrolling panel.
Use multiple tbody sections when rules are needed
between groups of table rows.
-->
<!ATTLIST thead
%attrs;
%cellhalign;
%cellvalign;
>
<!ATTLIST tfoot
%attrs;
%cellhalign;
%cellvalign;
>
<!ATTLIST tbody
%attrs;
%cellhalign;
%cellvalign;
>
<!ATTLIST tr
%attrs;
%cellhalign;
%cellvalign;
>
<!-- Scope is simpler than headers attribute for common tables -->
<!ENTITY % Scope "(row|col|rowgroup|colgroup)">
<!-- th is for headers, td for data and for cells acting as both -->
<!ATTLIST th
%attrs;
abbr %Text; #IMPLIED
axis CDATA #IMPLIED
headers IDREFS #IMPLIED
scope %Scope; #IMPLIED
rowspan %Number; "1"
colspan %Number; "1"
%cellhalign;
%cellvalign;
>
<!ATTLIST td
%attrs;
abbr %Text; #IMPLIED
axis CDATA #IMPLIED
headers IDREFS #IMPLIED
scope %Scope; #IMPLIED
rowspan %Number; "1"
colspan %Number; "1"
%cellhalign;
%cellvalign;
>
<!ENTITY % xhtml1 SYSTEM "http://www.w3.org/TR/xhtml1/DTD/strict.dtd">
%xhtml1;
<!ENTITY % xhtml1 SYSTEM "http://www.w3.org/TR/xhtml1/DTD/strict.dtd"> %xhtml1; <!ELEMENT category (#PCDATA)> <!ELEMENT abstract (#PCDATA)> <!ELEMENT keyword (#PCDATA)> <!ELEMENT last_updated (#PCDATA)> <!-- e.g. "1999 New York Women Composers", not "Copyright 1999 New York Women Composers" --> <!ELEMENT copyright (#PCDATA)> <!ELEMENT instruments (#PCDATA)> <!ELEMENT publisher (#PCDATA)> <!ELEMENT length (#PCDATA)> <!ELEMENT date (year | ISODate)> <!ELEMENT year (#PCDATA)> <!ELEMENT ISODate (#PCDATA)> <!ELEMENT catalog (category, cataloging_info, last_updated, copyright, maintainer, (composer | composition)*)> <!ELEMENT cataloging_info (abstract, keyword+)> <!ELEMENT description %Block;> <!ELEMENT maintainer (name)> <!ELEMENT name (first_name, middle_name, last_name)> <!ELEMENT first_name (#PCDATA)> <!ELEMENT middle_name (#PCDATA)> <!ELEMENT last_name (#PCDATA)> <!ATTLIST maintainer email CDATA #REQUIRED url CDATA #IMPLIED> <!ELEMENT composer (name)> <!ATTLIST composer id ID #REQUIRED> <!ELEMENT composition (title, date, length?, instruments, description?, publisher?)> <!ATTLIST composition composer IDREFS #REQUIRED> <!ATTLIST a href CDATA #IMPLIED>
<?xml version="1.0"?>
<!DOCTYPE document SYSTEM "http://www.w3.org/TR/xhtml1/DTD/transitional.dtd" [
<!ELEMENT document (p+) >
]>
<document>
<p>Hello There!</p>
</document>
Use XML syntax to describe the allowed content of an XML document rather than DTD syntax
Allow restrictions to be placed on PCDATA content; e.g. that the contents of an element must be an integer between 1 and 10
Area of active research and development
The XML Bible
Elliotte Rusty Harold
IDG Books, 1999
ISBN: 0-7645-3236-7
This presentation: http://metalab.unc.edu/xml/slides/sd2000west/dtds/