JDOM attribute with null value
843834Mar 9 2002 — edited Mar 10 2002I'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.