Q&A
Q. |
Why don't some of the example programs in this tutorial work in Mozilla Firefox and Opera? |
A. |
Unfortunately, some advanced XML features such as XML data islands and data binding vary from browser to browser, and aren't even supported in some browsers. This tutorial focuses on the Internet Explorer version of data islands and data binding. Mozilla Firefox has similar features although they are coded a little differently, while Opera has no support for either feature. |
Q. |
Can large documents create performance issues when I use the DOM? |
A. |
Yes. As you know, DOM parsers create a data structure that contains all of the data in an XML document, which means that all of the data is loaded into memory at once. If your XML document is really large (in comparison to the amount of RAM in the computer that your application runs on), performance issues can arise. In those cases, it may make more sense to use a SAX parser because it does not deal with the document as a whole. SAX is covered in the next tutorial, "SAX: The Simple API for XML." |
Workshop
The Workshop is designed to help you anticipate possible questions, review what you've learned, and begin learning how to put your knowledge into practice.
Quiz
1. |
From which interface in the DOM are all the others derived? |
2. |
The DOM is specific to which programming language? |
3. |
How do the |
4. |
Which interfaces support attributes? |
Quiz Answers
1. |
All of the interfaces in the DOM are derived from the |
2. |
Sorry, this is a trick question! The DOM is not specific to any programming language. |
3. |
The |
4. |
The |
Exercises
1. |
Write a script that converts all of the attributes in an XML document into child elements of the elements that they were associated with. |
2. |
Write a program that shows the names of only those elements that have attributes and no children. |