XML Declaration

Domain Hosting image
Web Hosting
Dedicated server
ssl certificate
Web Design image
Email

An XML document consists of declarations, elements, instructions and comments. All the components are not mandatory. The first structural element in an XML document is an optional prolog. The prolog consists of two basic components, namely the XML declaration and the document type declaration. The XML declaration identifies the version of the XML specification to which the document conforms. The syntax for XML declaration is

An XML declaration can also include an encoding declaration and a stand alone document declaration. The encoding declaration decides the encoding scheme. The encoding schemes available are UTF 8 and EUC JP. The coding schemes map to different character formats or languages. The stand alone document declaration identifies whether any markup declarations exist that are external to the document. This declaration can take in values of yes or no.

The Document Type Declaration

The document type declaration consists of the markup codes or the DTD according to which the XML document has to be written. The document type declaration can also point to an external file that contains the DTD. The document type declaration follows the XML declaration. The following codes illustrate how to define a document type. declaration'.

The above statement indicates to the XML processor that the document is of the class lib and conforms to the rules in the DTD named lib.dtd.

The Document Element

The document element contains all the data in an XML document. A single element can contain any number of nested sub elements and external entities. The following codes illustrate the use of the lib element.

<?xml version="1.0"?>
<!DOCTYPE LIB SYSTEM "lib.dtd">
<LIB><title>Mybook</title>
<Author>Myself</Author>
<ISBN>000-000-000</ISBN>
<PUBLISHER>the Nobody's press</PUBLISHER>
</LIB>

The process of embedding one object or construct within another is known as Nesting Nesting of elements creates a parent child relationship. Every child element resides completely within its parent element..



Domain Name Search

www.


Copyright (C) 2007. Web Domain design hosting. All rights reserved.