November 2002
Intermediate to advanced
1120 pages
21h 2m
English
Documents created with JDOM can have document type declarations and thus can be valid. JDOM does not offer a complete object model for DTDs, but it does allow you to point at an existing DTD or add an internal DTD subset to your documents.
Example 14.2 is a simple document type definition (DTD) for the Fibonacci number documents we've been generating.
<!ELEMENT Fibonacci_Numbers (fibonacci*)> <!ELEMENT fibonacci (#PCDATA)> <!ATTLIST fibonacci index CDATA #IMPLIED> |
Let's assume that this is available at the relative URL fibonacci.dtd. Thus the following DOCTYPE declaration would make the document valid:
<!DOCTYPE Fibonacci_Numbers SYSTEM "fibonacci.dtd">
In JDOM, the DocType class represents ...
Read now
Unlock full access