W3C home > Mailing lists > Public > www-tag@w3.org > May 2009

Re: more struggles with POWDER test materials

From: Cameron McCormack <cam@mcc.id.au>
Date: Fri, 15 May 2009 18:39:09 +1000
To: "Smith, Kevin, (R&D) VF-Group" <Kevin.Smith@vodafone.com>
Cc: phil@philarcher.org, hhalpin@ibiblio.org, connolly@w3.org, public-powderwg@w3.org, www-tag@w3.org
Message-ID: <20090515083909.GA22415@arc.mcc.id.au>
Hi Kevin.

Kevin Smith:
> Thanks for the snippet, which solves the problem as stated:
> however there was more to the problem than that: namely we need to
> regex-escape the string (not just deal with spaces). There may be
> a way to recurse on the string to achieve this: identify a segment
> before any of the regex reserved characters, concat() the escape,
> recurse until complete; but the problem there is that the escaped
> string still contains the reserved character. XSLT 1's translate()
> function can only cope with the translation of one character into
> another so that doesn't help us.

Indeed you should be able to solve that (and anything computable) in
XSLT 1, since it’s a Turing complete language.

> I wouldn't be surprised if one of the XSLT 1 gurus could find a
> heavyweight multi-template way around this; however it is exactly the
> sort of problem that replace() was introduced to deal with in XSLT
> 2.

Sure, and of course it would be a much better use of someone’s time to
just use XSLT 2 and its replace() function rather than rolling your own
in XSLT 1.  I’m quite enjoying using XSLT 2 at the moment for the SVG
WG’s spec building scripts.  I just wanted to point out that it’s not

Cameron McCormack ≝ http://mcc.id.au/
Received on Friday, 15 May 2009 08:40:13 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:56:28 UTC