Converting Document object (DOM) into inputsource for XSL process ing in XT

Subject: Converting Document object (DOM) into inputsource for XSL process ing in XT
From: Sebastien Sahuc <ssahuc@xxxxxxxxxxxxxx>
Date: Thu, 26 Aug 1999 16:29:52 +0200
Hi folks,

Currently, I'm working with DOM (SUN project X implementation) as a
represention of my Object. As I wish to submit the source tree through
an XSL style sheet using XT (for performance reason), I do need to
convert the DOM object into it equivalent inputsource as expressed in
the above java code :

ByteArrayOutputStream docOutputStream = new ByteArrayOutputStream();
((XmlDocument)myDOMDocument).write(docOutputStream);
ByteArrayInputStream docInputStream = new
ByteArrayInputStream(docOutputStream.toByteArray());
InputSource inputSource = new InputSource(docInputStream);
myXslProcessor.parse(inputSource);

Is there a better way to handle these opreations, since they're time
consuming in resource and memory. 

Beside this, I tried using DOM directly with XSL:P processor, but it
wasn't faster than XT solution, so I'm deducting that it take longer
to work with DOM that to parse again the XML document and then work
with it internal and lightweight representation, is it true ?

Thank for any reply, I would really appreciate.

Sebastien Sahuc
ssahuc@xxxxxxxxxxxxxx


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread