Home | Add to Favorites | Ebooks Directory | News  
XML Programming
Home
XML  Article
XML Tutorial 
XML sample code
Books
XML Articles
XML & Java
XML Syntax rules tutorial

All XML elements must have a closing tag

With XML, it is illegal to omit the closing tag.

In HTML some elements do not have to have a closing tag.


 

The following code is legal in HTML:

<p>This is a paragraph
<p>This is another paragraph

In XML all elements must have a closing tag, like this:

<p>This is a paragraph</p>
<p>This is another paragraph</p>


 

Unlike HTML, XML tags are case sensitive. Opening and closing tags must therefore be written with the same case:

All XML elements must be properly nested

In HTML some elements can be improperly nested within each other like this:

<b><i>This text is bold and italic</b></i>

All XML documents must have a root element

All XML documents must contain a single tag pair to define a root element.

All other elements must be within this root element.

                                                         
All elements can have sub elements (child elements). Sub elements must be correctly nested within their parent element:

<root>
<child>
 <subchild>.....</subchild>
</child>
</root>


Attribute values must always be quoted

Go To Index