spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / xml / column25

JDOM, The Java DOM

Technical Lead
Thomson Reuters (Markets) LLC
US-NY-New York

Justtechjobs.com Post A Job | Post A Resume
Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?


JDOM summary

Handling Attributes in JDOM

In JDOM, each attribute is represented as an Attribute object, which as a string name and a string value, plus a Namespace object (which may be Namespace.NO_NAMESPACE). Convenience methods can convert the attribute value to various types like int or double. JDOM enforces restrictions on attribute names and values. Attributes are stored in a java.util.List in the Element that contains them.

Handling Namespaces

Namespaces are represented by instances of the Namespace class rather than by attributes or raw strings. Always ask for elements and attributes by local names and namespace URIs, never identify an element or attribute by its qualified name, such as <vml:line>. Elements and attributes that are not in any namespace can be asked for by their local name alone.

JDOM limitations

JDOM, like all other current DOM implementations, constructs its documents in memory, so documents that are larger than available memory cannot be parsed. JDOM does not create identical, only equivalent documents when parsing and rewriting XML documents. It does not deal with DTDs as they are not XML documents, although the underlying validating parser uses them, of course. XPath Queries for navigating an XML document are announced for version 1.1.

Conclusion

JDOM is a convenient interface for Java programmers to have XML documents presented in a more Java-like fashion, reusing Java libraries and design patterns. Version beta 5 is out, have a look if you want to quit struggling with the comparatively awkward W3C DOM Java binding.

http://www.internet.com

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business

Produced by Michael Claßen
All Rights Reserved. Legal Notices.

URL: http://www.webreference.com/xml/column25/4.html
Created: Dec 03, 2000
Revised: Dec 03, 2000