O'Reilly logo

Secure XML: The New Syntax for Signatures and Encryption by Kitty Niles, Donald E. Eastlake

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

4.2. Document Type Declarations

An XML document refers to a DTD within an XML“<!DOCTYPE>” tag. The document type declaration can do either or both of the following:

  • Contain the markup declarations in an internal subset within the <!DOCTYPE> tag

  • Point to an external subset containing markup declarations

The document type declaration must appear before the first element in the document. Examples 4-1 and 4-2 provide samples of internal and external DTDs.

Example 4-1. Internal DTD
 <?xml version="1.0"?> <!DOCTYPE memo [ <!ELEMENT memo (to,from,subject,body)> <!ELEMENT to (#PCDATA)> <!ELEMENT from (#PCDATA)> <!ELEMENT subject (#PCDATA)> <!ELEMENT body (#PCDATA)> ]> <memo> <to>Jon</to> <from>Chris</from> <subject>Reminder</subject> <body>Three PM meeting ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required