[jdom-interest] String tree to DOM?

Cedric CLAUS cedric.claus at u-mangate.com
Sun Dec 14 06:22:33 PST 2003

Vic Cekvenich wrote:

> I am using a payment processing service and I create a Document using 
> elements to send them a XML Document as a String via API.
> They return a string... representation of an XML document.
> Is there a way that I can create a new Documment out of this String, 
> without having to parse it?
> (it's not an elment, the entire tree of a dcoument is there)
> tia,
> .V
> ps: is there more stuff coming out of jDom or is it parked?
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com 
I 've already do this thanks to Input Stream :

Create a ByteArrayInputStream with your String. Give this InputStream to 
a SAXBuilder.

public Document toDocument(String string) throws JDOMException, 
IOException {
       InputStream input = new ByteArrayInputStream(string.getBytes());
       SAXBuilder builder = new SAXBuilder();
       return builder.build(input);


More information about the jdom-interest mailing list