Oct
01
|
Use a StringReader for your InputSource.
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); InputSource source = new InputSource( new StringReader(xmlString)) Document document = factory.newDocumentBuilder().parse(source);
Array ( ) 2 Responses to “How do I create a DOM document from an XML String?”
Leave a Reply
You must be logged in to post a comment.
July 8th, 2011 at 10:52 am
Exactly what I wanted this time!!
Thanks!!
March 6th, 2012 at 2:51 am
Very useful, indeed !