Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Pro Java
Pro Java Expert level Java questions not about a specific book. Please indicate your version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro Java section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old February 7th, 2009, 05:54 PM
Authorized User
Join Date: Jun 2003
Posts: 79
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to erobb Send a message via Yahoo to erobb
Default 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">

<Property bisuniqueid="6172" name="SKILLS" occurrence="1">
<Attribute name="SKILL" sqldatatype="NUMERIC"/>
<Attribute name="YEAR_EXP" sqldatatype="NUMERIC"/>
<Attribute name="LEVEL" sqldatatype="NUMERIC"/>

<Property bisuniqueid="4385" name="JOB_CAT" occurrence="1">
<Attribute name="JOB_CATEGORY" sqldatatype="NUMERIC">8253425</Attribute>


Similar Threads
Thread Thread Starter Forum Replies Last Post
removeChild help John123 RSS and Atom 1 November 19th, 2007 12:56 PM
XML from a DB recordset (removal of &lt;&gt;) Thodoris XML 3 July 13th, 2004 12:28 AM
Java & Xml mehdi_979 XML 1 May 20th, 2004 11:47 PM
Java & Xml mehdi_979 J2EE 1 May 15th, 2004 06:03 AM
Need help with documentElement.removeChild adsioii XSLT 2 January 16th, 2004 02:12 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.