Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


XML and Java: DOM Level 1: Java XML API Definitions (W3C)

December 9, 1998

URL: http://www.w3.org/TR/REC-DOM-Level-1/java-language-binding.html

In contrast to the event-based model of SAX, the W3C's Document Object Model Level 1typifies a tree-base model. The pros and cons of these two different approaches are covered in Part 1 of this article. The key point is that the DOM is an in-memory tree representation of the document after the parsing completes.

The Java Language Binding for the DOM are downloadable from the W3C site. There is a Core (XML) portion and an HTML portion. In the Core, the following Java interfaces are defined for XML processing, with the Node being the most significant.

  • Node, NodeList, NamedNodeMap
  • Attr, Element
  • Document, DocumentFragment, DocumentType
  • CharacterData, Text, Comment, CDATASection
  • Notation, Entity, EntityReference
  • ProcessingInstruction

Since everything is a Node, you have to use the getNodeType method to determine whether you're dealing with, for instance, an Element node, and then getAttributes to retrieve the element's attributes.

In the HTML portion, Java interfaces such as HTMLDocument, HTMLElement, HTMLBodyElement, HTMLListElement, HTMLFormElement, HTMLScriptElement, HTMLAppletElement, and so on are defined.

The DOM is supported by XML Library, IBM's XML Parser for Java, SAXON, the Docuverse DOM SDK, and Coins. Since the DOM specifies an interface, expect that each vendors's implementation will differ with respect to details and extra features (such as convenience methods). See also the DOM Level 1 Recommendation, the DOM Activity page, and the DOM home page from the W3C site, and of course the WDVL article, The DOM Dissected.


XML and Java: XML Productivity Kit for Java (XPK4J by IBM)
XML and Java: The Perfect Pair: Part 2: Java APIs for XML
XML and Java: Serialization APIs

Enter your email address to receive mail when this XML section is updated:


Brought to you by NetMind,
home of URL-minder: Your Own Personal Web Robot!



Up to => Home / Authoring / Languages / XML / Java




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers