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
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't forget me this weekend!</body> </note> </xml>
or embedded in an external separate XML file like the following:
<xml id="note" src="note.xml"> </xml>
Note that the
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>
The above is the content of XML Guide-XML Data Island. For more related content, please pay attention to the PHP Chinese website (m.sbmmt.com)!