I read in the first snippet (identified by INPUT below) using SAXReader (both with setStripWhitespaceText to true and false). I then write out using XMLWriter with createPrettyPrint OutputFormat. I get the snippet identified below OUTPUT. Seems that the text of the elements that have newlines embedded in the element text get deleted along with the newlines. Obviously not what I want (well, maybe not obvious ;-)
Suggestions? thanx steve p.s. this was my workaround to an earlier question about stripping whitespace within an element. ********* INPUT *********** <agent> <name> blueDude </name> <side> BLUE </side> <sensors> BlueSensor </sensors> <commDevices> Blue1 </commDevices> <movement> BlueMovement </movement> <decisions> viewSensors movement </decisions> <movementComponents> BlueMovementComponents </movementComponents> <commInterval> 20.0 </commInterval> <sentiment>BlueSentiment</sentiment> <refData>BlueReference</refData> </agent> ************ OUTPUT ********** <agent> <name>blueDude</name> <side>BLUE</side> <sensors/> <commDevices/> <movement/> <decisions/> <movementComponents/> <commInterval>20.0</commInterval> <sentiment>BlueSentiment</sentiment> <refData>BlueReference</refData> </agent> *********** ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ dom4j-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dom4j-user