Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Turn a string (which is essentially a Document.toString())" back into a Document?

 
Goofus McDoofus
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In order to return a Document from an RPC (SOAP), I am turning it into a string (for serialization).
I want to use stylesheets to display the results on the client. Is there a utility which will turn this String back into a Document (or am I barking up the wrong tree)?
 
Rangarajan Suresh
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Goofus McDoofus:
In order to return a Document from an RPC (SOAP), I am turning it into a string (for serialization).
I want to use stylesheets to display the results on the client. Is there a utility which will turn this String back into a Document (or am I barking up the wrong tree)?


StringReader XMLStringReader = new StringReader(documentString ));
InputSource source = new InputSource(XMLStringReader);
then, use the source to get a document using DocumentBuilder.parse()
I am assuming that u meant org.w3c.Document as Document
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic