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 rootElement element in the following example has an attribute named attr:

<?xml version="1.0"?> 
<rootElement attr="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.221.53.5