Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

Re: [jdom-interest] String tree to DOM?

Cedric CLAUS

2003-12-14

Replies:

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@(protected)
>
>
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);
 }

Ced


_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@(protected)


©2008 junlu.com - Jax Systems, LLC, U.S.A.