XML Guide--xml data island

Source: Internet
Author: User
Tags html page
xml| data uses IE5.0 or a higher version, and XML data can be embedded in an HTML page as a data island.



Embed XML data in an HTML page
Use the unofficial standard <xml> tag to embed XML data into an HTML page.
XML data can be embedded in an HTML page as in the following example:
<xml id= "Note" >
<note>
<to>Tove</to>
<from>Jani</from>
<body>don ' t forget me this weekend!</body>
</note>
</xml>

Or embed an externally separate XML file as follows:
<xml id= "Note" src= "Note.xml" >
</xml>


Note that the <xml> 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 elements within an HTML table are bound to each other using the datafld attribute and the corresponding XML elements of the XML document.
<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>



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.