xsl-list
[Top] [All Lists]

Re: [xsl] Identify transform with disabled output escaping

2006-11-15 11:25:07
Hello Michael,

You must be doing something very strange to get that. But without seeing
what you're doing, I'm guessing.

OK, instead of showing you what I am doing, I will tell you what would I
like to do:

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 my next try was to actually use a stylesheet - an identity stylesheet
with DOE 'on'. However I bumped into the problem that it is not so
trivial to 'turn on' DOE and that was the time when I have sent my first
mail to the ML.

However, after your reply I am wondering if the problem could be
elsewhere - the weird result was copied from the GUI, so maybe there is
an extra escaping step before the string get's written to the GUI? I
have to check.

Thanks for your replies,
Peter












--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--