Home > Backend Development > XML/RSS Tutorial > XML Guide - XML ​​Data Island

XML Guide - XML ​​Data Island

黄舟
Release: 2017-02-11 15:20:37
Original
1723 people have browsed it

Using IE5.0 or higher, XML data can be embedded in HTML pages in the form of data islands.
Embedding XML data in HTML pages
Xml data can be embedded into HTML pages using the unofficial standard tag.
XML data can be embedded in an HTML page like the following example:

<xml id="note">    
<note>    
<to>Tove</to>    
<from>Jani</from>    
<heading>Reminder</heading>    
<body>Don&#39;t forget me this weekend!</body>    
</note>    
</xml>
Copy after login


or embedded in an external separate XML file like the following:

<xml id="note" src="note.xml">  
</xml>
Copy after login


Note that the tag is an HTML element, not an XML element.



Data binding
XML data islands can be bound to HTML elements (such as tables).
In the following example, an XML data island (ID=cdcat) is loaded from an external XML document. An HTML table is bound to this data island. The span element inside the HTML table uses the datafld attribute to bind to the corresponding XML element of the XML document.

<html>   
<body>   
<xml id="cdcat" src="cd_catalog.xml"></xml>   
<table border="1" datasrc="#cdcat">   
<tr>   
<td><span datafld="ARTIST"></span></td>   
<td><span datafld="TITLE"></span></td>   
</tr>   
</table>   
</body>   
</html>
Copy after login

The above is the content of XML Guide-XML Data Island. For more related content, please pay attention to the PHP Chinese website (www.php.cn)!


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template