Accessing XML Data Using DOM

You can access XML data from the Document object by using its member methods. You will update the MyDOMHandler application to get the following information from the CarParts.xml file:

  • DTD information

  • Element node types

  • An element node and its attributes (accessed randomly)

  • An element's text node

Accessing DTD Information

A DTD describes the structure of the content of an XML document. It defines the elements, their order, and relation with each other. A DTD also defines the element attributes and whether the element and/or attributes are mandatory or optional. You can use a DTD to ensure that the XML document conforming to the DTD is well-formed and valid. You might want to access the DTD information for various reasons. ...

Get Java™ APIs for XML Kick Start now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.