Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JDOM attribute with null value

843834Mar 9 2002 — edited Mar 10 2002
I'm creating a DOM tree using JDOM. All attribute values are retrieved from a database. I setAttribute:

element_xx.setAttribute("attribute_xx", resultSet_xx.getString("RS_Column_xx"));

However, if the value (from resultSet_xx) contains null, an exception occurs:

Exception:
The data "null" is not legal for a JDOM attribute: A null is not a legal XML value.

I don't want to validate each data inside the resultSet against null values before setting the attribute. Please advice.

J.J.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 7 2002
Added on Mar 9 2002
2 comments
705 views