![]() | |
Using DOM Parser and NameSpaces Current DOM (Document Object Model) is under Level 1 Specification which can be downloaded from the W3C Site The Document Object Model (DOM) provides APIs that let you create nodes, modify them, delete and rearrange them. However, the Level 1 DOM specification is silent on the subject of how to input and output. It tells you how a DOM has to operate, but does not cover methods for for reading or writing XML. As a result, you can't create a DOM from an existing XML file without going outside the DOM Level 1 specification. So Sun implemented it's process of Reading the XML file, which might change according to future specifications. Currently it's through FileInputStream and URLDataInputStream DOM Parser internally uses SAX parser to parse the XML file and create the Tree. So all the errors thrown while parsing the XML file will be almost same as the SAX Parser. Traversing Nodes Using NamespacesNames spaces is to avoid confusion when two different Element wants to have same Attribute Names or Elements names declared in the XML file clash with the External DTD, if we want to use the XHTML DTD for example. Note: At this point in time, the Sun's Java XML parsers do not support namespaces.
|