The Document Type Declaration

printer-friendly version of this section  Print  e-mail this section  E-Mail  add a public, group or private note  Add Note  add a bookmark about this section  Add Bookmark    

Java APIs for XML Kick Start
By Aoyon Chowdhury, Parag Choudhary

Table of Contents
Appendix B.  XML: A Quick Tour


The document type declaration is the XML statement that declares the type of XML document and also identifies the DTD as being SYSTEM or PUBLIC. The document type declaration is as follows:

<!DOCTYPE name external pointer[internal subset] 

In the DOCTYPE declaration statement, the name argument is the name of the root element. If the DTD is an external file, the external pointer argument after name is the combination of PUBLIC or SYSTEM, depending on where the DTD is located and the URI to the DTD. For example, if the DTD for the CarParts.xml were defined in the http://www.carheaven.com/dtds/CarParts.dtd, then the DOCTYPE declaration would have been

<!DOCTYPE carparts SYSTEM "http://www.carheaven.com/dtds/CarParts.dtd"> 

If the DTD is defined within the XML document, the only argument that you need to specify is the name, which has to be the same as that of the root element. In case of CarParts.xml, the DTD is defined internally within the XML file, so the DOCTYPE declaration is as follows:

<!DOCTYPE carparts[ ....... ]> 

printer-friendly version of this section  Print  e-mail this section  E-Mail  add a public, group or private note  Add Note  add a bookmark about this section  Add Bookmark    
Top

[0672324342/app02lev1sec13]

 
 


JavaT APIs for XML Kick Start
JAX: Java APIs for XML Kick Start
ISBN: 0672324342
EAN: 2147483647
Year: 2002
Pages: 133

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net