|
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
|
Title: Message
- [dom4j-user] Using a Document as XSL David Hooker
- James Strachan
