[jdom-interest] Document from a string?

Goswami, Raj Purnendu_Goswami at csx.com
Mon Jul 21 12:58:13 PDT 2003


StringReader sReader = new StringReader(myString);
Document doc = builder.build(sReader);


Thanks, 

Raj Goswami 



-----Original Message-----
From: William Krick [mailto:wkrick at eio-online.com]
Sent: Monday, July 21, 2003 3:53 PM
To: jdom-interest at jdom.org
Subject: [jdom-interest] Document from a string?


How do I create a JDOM Document from a java String?

My String is returned from a database "getString()" call.

My first instinct was to use something like...

String myString = "..."; // the results of getString() call
SAXBuilder builder = new SAXBuilder();
Document doc = builder.build(myString);

...but it seems that SAXBuilder only takes files, streams and URLs.

...
Krick



_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhos
t.com



More information about the jdom-interest mailing list