Here are some technologies you should try to avoid when using XML
Internet Explorer XML Data Islands
What is it? An XML data island is XML data embedded into an HTML page.
Why avoid it? XML Data Island only works with Internet Explorer browsers.
What to use instead? You should use JavaScript and XML DOM to parse and use XML data in HTML.
For more information about using JavaScript and the XML DOM to get and use information from XML in HTML pages, visit our XML DOM tutorial.
Example - Embed XML Data in a HTML Table
Here is how it works; assume we have the following XML document ("cd_catalog.xml"):
View "cd_catalog.xml"
Then, in an HTML document, you can embed the XML file above with the
The next step is to format and display the data in the data island by binding it to HTML elements.
The HTML file looks like this:
|
Example explained:
The datasrc attribute of the
tags cannot be bound to data, so we are using tags. The tag allows the datafld attribute to refer to the XML element to be displayed. In this case, it is datafld="ARTIST" for the If you are running IE (5.0 or higher), you can try it yourself. Also try this example, demonstrating , , and .Internet Explorer BehaviorsWhat is it? Internet Explorer 5 introduced behaviors. Behaviors are a way to add behaviors to XML (or HTML) elements with the use of CSS styles. Why avoid it? The behavior attribute is only supported by Internet Explorer. All other browsers will ignore it. What to use instead? Use JavaScript and XML DOM (or HTML DOM) instead. For more information about using JavaScript and the XML DOM to get and use information from XML in HTML pages, visit our XML DOM tutorial. Example 1 - Mouseover HighlightThe following HTML file has a Mouse over me!!! |