A holder for an XSL Transformation result, generally a list of nodes although it can be a JDOM Document also. As stated by the XSLT 1.0 specification, the result tree generated by an XSL transformation is not required to be a well-formed XML document. The result tree may have "any sequence of nodes as children that would be possible for an element node".
The following example shows how to apply an XSL Transformation to a JDOM document and get the transformation result in the form of a list of JDOM nodes:
public static List transform(Document doc, String stylesheet) throws JDOMException { try { Transformer transformer = TransformerFactory.newInstance() .newTransformer(new StreamSource(stylesheet)); JDOMSource in = new JDOMSource(doc); JDOMResult out = new JDOMResult(); transformer.transform(in, out); return out.getResult(); } catch (TransformerException e) { throw new JDOMException("XSLT Transformation failed", e); } }
@see org.jdom.transform.JDOMSource
@version $Revision: 1.24 $, $Date: 2007/11/10 05:29:02 $
@author Laurent Bihanic
@author Jason Hunter