DTD > Structure > DTD DOCTYPE

Using the DOCTYPE node it is possible to specify a set of DTD Schema rules that are defined inline within the XML Document

The square brackets [...] contain the DTD Schema rules.

InlineSchema.xml Copy Code
<?xml version="1.0"?>
<!DOCTYPE note [
    <!ELEMENT note (to,from,heading,body)>
    <!ELEMENT to (#PCDATA)>
    <!ELEMENT from (#PCDATA)>
    <!ELEMENT heading (#PCDATA)>
    <!ELEMENT body (#PCDATA)>
    <body>Don't forget me this weekend</body>

EBNF Syntax

The syntax for an XML DOCTYPE described by the W3C as using EBNF as follows.

[28]  doctypedecl       ::= '<!DOCTYPE' S Name (S ExternalID)? S? ('[' intSubset ']' S?)? '>'

See Also

Try Liquid XML Free and see how we can help you today Free Trial