|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Java code doing transformation
The 'JavaTM API for XML Processing (jaxp-1.1) has a series of examples.
just to give an idea, it
looks like this
...
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer(new StreamSource(xslfi
le));
transformer.setParameter("what",this);
DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = dfactory.newDocumentBuilder();
Document outDoc = docBuilder.newDocument();
transformer.transform(new StreamSource(in),
new DOMResult(outDoc));
...
or
...
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer(new StreamSource(xslfi
le));
transformer.setParameter("what",this);
transformer.transform(new StreamSource(in),
new StreamResult(new FileOutputStream(out)));
...
you can also get the result handed to an SAXParser
carst
--
Carsten Heinrigs
Ocean-7 Development
Tel: 212-533-8460
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








