XML Data Islands

If you are looking for a hassle-free way to display your XML data in the browser in the HTML format (without using stylesheets), you should familiarize yourself with the concept of an XML data island. With XML data islands (introduced in Internet Explorer 5.0), you can easily bind HTML tags to data fields in your XML document. A data island is a segment of XML code within an HTML document. You can embed data in XML format directly into an HTML page by using the xml element. To see how this is done, take a look at Figure 17-20. In this example, the XML data island is the code fragment between the following comment lines: <!-- BEGINNING OF XML Data Island --> and <!-- END OF XML Data Island -->.

An HTML document can contain one or more data islands (groups of XML). Notice that the xml element contains an attribute named ID that specifies a reference to the data island. This reference is used later in the code to refer to the source data for the HTML table (see the datasrc attribute within the <TABLE> tag in the HTML Formatting Instructions section in Figure 17-20).

0 0

Post a comment