[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Identify transform with disabled output escaping

Subject: RE: Identify transform with disabled output escaping
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 15 Nov 2006 19:57:20 -0000
output escaping in dom
> 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 &gt;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/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.