xsl-list
[Top] [All Lists]

Re: [xsl] Preserving numeric character entity reference

2007-02-14 08:54:30
On Wednesday 14 February 2007 12:10, Abel Braaksma wrote:
You didn't specify the version of XSLT you are using, but here are a
couple of ways that work with XSLT 2:

Ah, right. And it is even recommendation now... :-) I use libxslt 1.1.17 
with mod_xslt, so whatever capabilities they have. I assume that means 
XSLT 1.

2. Use strings like   if obfuscation is all you want, and
make sure to translate them back (translating character entities
never cascade, i.e., &32; stands for the string " " and not
for the entity  , as such you need to do extra translation to go
from   back to a space char)
  3. Use CDATA sections. But this creates different strings, the same
way as with (2).

I think (2) and (3) will work well with XSLT 1 as well, but both
require you to do extra work in your obfuscating tool.

Right. I can do that pretty easily. I allready tried to use CDATA around 
the whole HTML string, but that would escape the whole string. And 
various combinations of cdata-section-elements and 
disable-output-escaping. But I'm not grokking too much.

Then I put a CDATA around just the character entities. And tried the 
&, but how would I then go about to translate it back?

Or should I go with a template approach, where I go into the XHTML 
fragment and do an value-of with disable output escaping?

Cheers,

Kjetil
-- 
Kjetil Kjernsmo
Information Systems Developer
Opera Software ASA

--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>