[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Identify transform with disabled output escaping
> I have an org.w3c.dom.Node, and I would like to serialize it > to a String. To achieve this, I have been using this code: > > void writeDOMToSourceNode(Node n, StreamResult sr) { > TransformerFactory trf = TransformerFactory.newInstance(); > Transformer tr = trf.newTransformer(); > tr.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); > tr.transform(new DOMSource(n), sr); > //exception handling and turning the sr into a String omitted } > > i.e. transform the Node with an empty stylesheet. Now this > code gives me the strange stuff with all the >s et al. So the next question has to be, what's in the DOM? From the evidence of the serialized output, it's some text nodes with lots of angle brackets in the text. Have you tried using the DOM's serialization methods (toXML() or whatever) directly? Michael Kay http://www.saxonica.com/
|
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
|