Breaking News

XML Data island

What is Data Island?
 
By using the unofficial <xml> tag can embed xml data into HTML file (<xml> tag is non-standard tag and works only with Microsoft Internet Explorer) .As we know HTML is used for presentation of data and XML is used for storage of data and XML does not know anything about how to present the data.
With the help of XML data island we can load specified XML file and then display the content of XML file in HTML page.
 
Note: <xml> tag is unofficial and works only with Microsoft Internet Explorer and if you are using any other browser then you might not be able to see the output of following example.
 
 
Bind Data Island to HTML Elements
 
Example:
 
<html>
<body bgcolor=”pink”>

<xml id=”address”  src=”simple.xml”></xml>

<table border=”1″ datasrc=”#address” bgcolor=”pink”>
<thead>
<tr bgcolor=”cyan”>
<th>Name</th>
<th>Address</th>
<th>City</th>
<th>State</th>
<th>Pin</th></tr>
</thead>
<tfoot>
<tr><th colspan=”5″>csitquestion Student Address details</th></tr>
</tfoot>
<tbody>
<tr>
<td><span datafld=”name”></span></td>
<td><i><span datafld=”address_str”></span></td>
<td><span datafld=”city”></span></td>
<td><span datafld=”state”></span></td>
<td><span datafld=”pin”></span></td>
</tr>
</tbody>
</table>
</body>
</html>

 
Click here to view the parser output.
 
Note: <xml> tag is unofficial and works only with MS IE and if you are using any other browser then you might not be able to see the output of following example.
 
 
Source code of simple.xml
 
<?xml version=”1.0″ encoding=”UTF-7″?>
<ebiz>
  <address>
    <name>Dharmendra Das</name>
    <address_str>D 210</address_str>
    <city>New Delhi</city>
    <state>Delhi</state>
    <pin>110000</pin>
  </address>
  <address>
    <name>XYZ Kumar</name>
    <address_str>b 66</address_str>
    <city>Noida </city>
    <state>UP</state>
    <pin>201301</pin>
  </address>
   <address>
    <name>Sam </name>
    <address_str>Karmpura</address_str>
    <city>Noida </city>
    <state>UP</state>
    <pin>201301</pin>
  </address>
   <address>
    <name>K Kumar</name>
    <address_str>b 66</address_str>
    <city>Noida </city>
    <state>UP</state>
    <pin>201301</pin>
  </address>
  <address>
    <name>VJ</name>
    <address_str>e 66</address_str>
    <city>New Delhi </city>
    <state>Delhi</state>
    <pin>201301</pin>
  </address>
  <address>
    <name>Amu</name>
    <address_str>J 3</address_str>
    <city>Noida </city>
    <state>UP</state>
    <pin>201301</pin>
  </address>
</csitquestion>

Check Also

XML and Server

Generating XML with JSP   XML can be generated on a server without any installed …