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.
How do I parse an XML, which is stored in a String? Assume the string name is xmlString. It contains 'employee' as root node and firstname, lasename, address as child node.
I tried the following with xml4J parser. 1. Create a parser object Parser p = new Parser("parser.err"); 2. converting a string into an inputstream. ByteArrayInputStream is = new ByteArrayInputStream(xmlString.getBytes());
3. Create the DOM tree TXDocument document = parser.readStream(is); here, document(DOM tree) is null. So, I am not able to get the root element. Why is that??? Thanks