Re: [xsl] Safe-guarding codepoints-to-string() from wrong input

Subject: Re: [xsl] Safe-guarding codepoints-to-string() from wrong input
From: Abel Braaksma <abel.online@xxxxxxxxx>
Date: Wed, 20 Dec 2006 19:14:05 +0100
Florent Georges wrote:
  Technically, it is not complex.  Just define a function
my:codepoints-to-string() that makes the needed checks and
do what you want when encoutering an invalid codepoint.  I
think the most difficult part is identifying which
codepoints are valid.  You can use the following from the
XML recommendation as starting point:

Florent: wow! Just wow ;)


Thanks for the extensive explanation and the detailed xsl code. With all the possibilities to treat a non-number or div-by-zero without exceptions, I'm a little at odds as to why working with characters (which is at the basis of any xslt transform) is not made so rock-solid. Why didn't they invent something like <xsl:number> for characters?

Funny, I never knew when/where to use the xsl:sequence constructor, I'm glad to have found a use through your code.

Your code has been implemented into my filters. Thanks again!

Cheers,
-- Abel

Current Thread