Elements and attributes

XML is similar in appearance to HTML. Elements begin and end with a tag name. The tag name describes the name of an element. For example:

<?xml version="1.0"?> 
<rootElement>value</rootElement> 

An XML document can only have one root element, but an element may have many descendants:

<?xml version="1.0"?> 
<rootElement> 
<firstChild>1</firstChild> 
<secondChild>2</secondChild> 
</rootElement> 

An element may also have attributes. The element rootElement in the following example has an attribute named attr:

<?xml version="1.0"?> 
<rootElementattr="value"> 
   <child>1</child> 
</rootElement> 
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.170.187