Re: Best way to handle multiple string replacements?

Subject: Re: Best way to handle multiple string replacements?
From: Warren Hedley <w.hedley@xxxxxxxxxxxxxx>
Date: Wed, 07 Jun 2000 10:37:59 -0400
Wow, you guys are taking this a lot further than I'd
originally considered. As Paulo Gaspar pointed out, XSLT
is probably not the ideal tool for this kind of processing
anyway, and David Carlisle may yet remove the need to
transcode the ``high'' characters anyway - I'm not quite
there yet.

Jeni Tennison wrote:
> 
> My second objection was that it would get a bit more complicated when you
> had substitutions of things that were of arbitrary length (i.e. strings
> rather than single characters).  That wasn't a problem in Warren's example,
> but I was aiming for reusability.  A look-ahead mechanism could probably
> get around that?

Actually, this is becoming a problem with another stylesheet I've
been playing with for the last few months - one that pretty-prints
DTDs in HTML (where the DTDs are embedded in an XML document, and
all <'s are escaped, so that you just get text nodes and comments.)
I'm currently processing the text nodes almost character by character
and using starts-with() to look ahead occasionally to see what sort
of objects I've reached.

I'm currently leaning towards this approach for the latex processing too,
because of the ordering problems that Sebastain mentioned. I mainly use
Saxon, so if Mike says that it uses tail recursion, then the ridiculous
levels of recursion that this approach frequently involves should hopefully
not be a serious problem.

Thank you both for your input.

-- 
Warren Hedley


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread