Title: Output XML with stylesheet from DOM

I have a DOM Document representing an xml file and I want to save it to a file with an embedded xml-stylesheet link:
<?xml-stylesheet href="" type="text/xsl"?>

Here is my code so far. How do I add the stylesheet link? I don't want xalan to process the stylesheet.

DOMSource xml_source = new DOMSource(document);
StreamResult result = new StreamResult(out);   
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer();
transformer.transform(xml_source, result);

Please reply directly to me as I'm not subscribed to the list.

Thanks.
Dave.


________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

Reply via email to