XML Notes
This section lists 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 in an HTML page.
**Why avoid it?** XML data islands only work in the Internet Explorer browser.
**What to use instead?** You should use JavaScript and XML DOM in HTML to parse and display XML.
For more information about JavaScript and XML DOM, please visit our XML DOM Tutorial。
XML Data Island Example
This example uses the XML document "cd_catalog.xml"。
to bind the XML document to a
Example
This example only works in the IE browser
Try it »
The tag allows the datafld attribute to reference the XML element to display. In this example, the references are "ARTIST" and "TITLE". When the XML is read, a corresponding table row is created for each
Internet Explorer - Behaviors
**What is it?** Internet Explorer 5 introduced behaviors. A behavior is a way to add behavior to an XML (or HTML) element by using CSS styles.
**Why avoid it?** Only Internet Explorer supports the behavior attribute.
**What to use instead?** Use JavaScript and XML DOM (or HTML DOM) instead.
Example 1 - Mouse-Over Highlight
In the HTML file below, the
element uses a behavior defined in the XML document "behave.htc" shown below (which contains JavaScript and event handlers for elements):
Try it »
Example 2 - Typewriter Simulation
In the HTML file below, the
IE5 introduced DHTML behaviors.
Behaviors are a way to add DHTML functionality to HTML elements
with the ease of CSS.
How do behaviors work?
By using XML we can link behaviors to any element in a web page
and manipulate that element.
vBelow is the XML document "typing.htc":
Try it »