[jdom-interest] String tree to DOM?
Stefan Schoenmackers
stef at cparity.com
Sun Dec 14 16:54:03 PST 2003
Alternatively, you could use the StringReader class. I think it's a bit
safer with UTF characters, but I could be wrong about that.
--Stef
On Sun, 14 Dec 2003, Cedric CLAUS wrote:
> 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);
> }
>
> Ced
>
>
> _______________________________________________
> To control your jdom-interest membership:
> http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@yourhost.com
>
More information about the jdom-interest
mailing list