Because you are not manipulating the dom4j document programatically,
I wouldn't use dom4j for this task.

You are performing the following tasks:
- create an input dom4j document from an input-stream,
- transform the document, (might make another DOM)
- into a resulting dom4j document,
- write the resulting dom4j document.

Without doing any performance tests, this does not seem to be
particularly efficient.

Instead the following would maybe be better:
- transform the input-stream, (makes a DOM internally)
- write the result while transforming.

The following code is not tested:

SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
Transformer transformer =
    TransformerFactory.newInstance().newTransformer(new
StreamSource("/scheda.xslt"));
transformer.setOutputProperty("method", "html");
transformer.transform(
    new SAXSource(parser.getXMLReader(), new InputSource(url)),
    new StreamResult(pageContext.getOut()));

This only creates (at most) one document in memory and writes the results
directly to the writer. For even less memory use, please check out
Saxon tinytree mechanism: http://saxon.sourceforge.net/

Regards,
Edwin
-- 
http://www.edankert.com/

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
dom4j-user mailing list
dom4j-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to