Title: Message
Yes dom4j can be the source of the XML, the stylesheet or the result of the transformation. All other sources and results are supported too (text, SAX, DOM etc)
 
You just create an org.dom4j.io.DocumentSource for the xml or stylesheet document or a DocumentResult for the result then use the standard JAXP Transformer interface. There's an example on the quick start guide...
 
 
Here's a quick snippet of code to show the kind of thing...
 
Document stylesheet = ...;
 
TransformerFactory factory = TransformerFactory.newInstance();
        Transformer transformer = factory.newTransformer(
            new DocumentSource( stylesheet )
        );
Document document = ..;
DocumentSource source = new DocumentSource( document );
DocumentResult result = new DocumentResult();
transformer.transform( source, result );
 
Document output = result.getDocument();

James
----- Original Message -----
Sent: Friday, November 02, 2001 5:13 PM
Subject: [dom4j-user] Using a Document as XSL

I've seen in the samples how to use a StreamSource for the XSL file when doing a transformation.  Is there a way to use a dom4j Document (read from the XSLT file) as the stylesheet?

Reply via email to