This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi all, I'm in the process of manipulating an XML file using DOM Api. Somewhere I have to copy Nodes from one part of the XML to another part. I'm using insertBefore method to insert a Node as first child of the parent Node. The problem is that after the node is inserted, the carriage return is missing. I'd like to insert a carriage return immediately after. How can I accomplish it ? Thanks a lot Francesco
What you see as a carriage return in the XML document is actually a Node of the TEXT_NODE type with a nodeValue of "\r\n". You will have to create and add this Node separately. Formatted XML documents are FULL of text nodes that are not immediately obvious - thats why getFirstChild() may not return what you expected. Bill