xslt preserve entity

March 24th, 2009
Tags: xslt Posted in :-)Say something

To be more accurate, this way preserves the UTF-8 xml character entity as UTF-8 character entity. There are some other suggestions like using character map, feels too much trouble.

So how to do it:

in the xsl output tag, add this attribute:

encoding="ASCII"

Done!

Some other xsl tips I recently used in my hadoop XSLT job:

1) wrapping data in a CDATA (or construct a CDATA node using XSLT, not the best way but get the job done)

<![CDATA[
....
]]
>

2) remember how to apply-templates, it's recursive, (later that day I learned how to use settimeout in Javascript, which again if you know how to use it recursively, it's very powerful)

3) use copy-of to preserve the xml nodes or html tags inside a wanted node

gphone activation through wifi»
«hadoop source jar

我要留言

5+2=