Java Mailing List Archive

Home » JDOM Projects »

[jdom-interest] Content missing after conversion from W3C Element
 to JDOM2 Element



Replies: Find Java Web Hosting

Author LoginPost Reply

I am quite a JDOM2 newbie and noticed strange/incorrect behaviour when
converting a W3C-Element to a JDOM-Element. Though, I can´t imagine that
this really is a bug as I guess that somebody else would have noticed and
probably fixed this before. Also, I couldn´t find other people having this
problem. So, at the moment I would rather think that I am doing something
wrong here.

This is the part that I want to convert from W3C to JDOM stored in the
variable "table":

  <tr id="0">
    <td id="0">

This is my code:
  DOMBuilder domBuilder = new DOMBuilder();
  Element jdomTable =;

After this conversion, I have a JDOM element with the correct structure,
but the content from the img-tag is missing.
I fixed this problem by importing the JDOM source into my project and
changing this method:

  public org.jdom2.Text build(org.w3c.dom.Text text) {
     // BUG ???
     // return factory.text(text.getTextContent());
     return factory.text(text.getNodeValue());

Could anyone please shed some light if this is a bug or a mistake on my

To control your jdom-interest membership:
©2008 - Jax Systems, LLC, U.S.A.