[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Multiple String Replacements [with a twist]


Subject: Re: [xsl] Multiple String Replacements [with a twist]
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 27 Mar 2007 21:19:49 +0100

are ypu using xslt 2 or xslt 1 (it's easier in 2) but basically you are
losing nodes because the string functions such as substring-before
conver their arguments to a string, and the strig value of a node is
just the character data of all its descendants.

Basically the thing to do is apply templates to your source and then
apply teh trplacement to text nodes ie match="text()" so you do the
replacemet to each text string separately and then there are no nodes to
lose in the process. The FAQ has exapmes (I think) and teh archives of
this list have plenty too, but I'm not sure of the details of what ypu
need as I don't think you showed your input file, or the format of your
multiple replacement specification, just the format of one replacement.

David


Current Thread
Keywords