Java & XML removeChild() Formatting
Has anyone seen formatting issues when trying to do removeChild on an Element (Property) If so I would be in your debt if you could tell me what method I should use to clean up the XML.
I want the spaces out of the XML
remove children & parents
********************************
if( !elemSave ){
while( ((Element) n).hasChildNodes() ) {
((Element) n).removeChild( ((Element) n).getLastChild() );
}
((Element) n).getParentNode().removeChild((Element) n);
}
return document;
------------------------XML RESULT-----------------------
<?xml version="1.0" encoding="UTF-8"?>
<Entity createddate="6/19/08" defaultrole="CONTR_CAND" id="93023" updateddate="2/6/09">
<Role>CONTR_CAND</Role>
<Property bisuniqueid="6172" name="SKILLS" occurrence="1">
<Attribute name="SKILL" sqldatatype="NUMERIC"/>
<Attribute name="YEAR_EXP" sqldatatype="NUMERIC"/>
<Attribute name="LEVEL" sqldatatype="NUMERIC"/>
</Property>
<Property bisuniqueid="4385" name="JOB_CAT" occurrence="1">
<Attribute name="JOB_CATEGORY" sqldatatype="NUMERIC">8253425</Attribute>
</Property>
</Entity>
|