JAXP
javax.xml.transform.Source implementation
that marshals a JAXB-generated object.
This utility class is useful to combine JAXB with
other Java/XML technologies.
The following example shows how to use JAXB to marshal a document
for transformation by XSLT.
MyObject o = // get JAXB content tree
// jaxbContext is a JAXBContext object from which 'o' is created.
JAXBSource source = new JAXBSource( jaxbContext, o );
// set up XSLT transformation
TransformerFactory tf = TransformerFactory.newInstance();
Transformer t = tf.newTransformer(new StreamSource("test.xsl"));
// run transformation
t.transform(source,new StreamResult(System.out));
The fact that JAXBSource derives from SAXSource is an implementation
detail. |