Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

[jdom-interest] a question about node type

Grzegorz Kaczor

2006-12-06

Replies:

Hello,

JDOM is a very convenient interface to manipulate XML elements but I
think it lacks one useful functionality that is present in W3C DOM
implementation - a node type distinction available from Content class.

Let's say I want to perform something for each node (and for each type
of node a different activity) - for example I want to replace all
lowercase 'a' letters to uppercase ones - in element text content, in
attribute values, in CDATA sections and so on (this is an exemplary
action). Do I have to use reflection for that?

In W3C DOM I can use getNodeType() to distinguish node types and perform
the replace recursively. How can I do the same using JDOM and not using
'instanceof'?

Best Regards,
Grzegorz



This email is subject to Computaris email terms of use: http://www.computaris.com/email_terms.html
_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/youraddr@(protected)
©2008 junlu.com - Jax Systems, LLC, U.S.A.