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)> ]> <note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend</body> </note> |
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?)? '>'