|
Subject: [xsl] char replacement From: Philippe Figon <philippe.figon@xxxxxxxxxxxx> Date: Thu, 9 May 2002 06:19:07 +0200 |
Hellolinefeed
I am trying to write a stylesheet that could replace all the carriage return
(CR) characters (Unicode 'xD') in the text() node of an element with
something else.
Let's put it simple ! I have an element named 'screen' with some text within
and I'd wish to put something like ~\\ at the end of each line (LaTeXing
isn't it ?):
<screen>
agdh djdjdkk
whjjd kdopd
shdm gfjkmd
hdjdj kkdddl
</screen>
should become :
agdh djdjdkk~\\
whjjd kdopd~\\
shdm gfjkmd~\\
hdjdj kkdddl~\\
I wrote a stylesheet like this :
(the output method is 'text')
<xsl:template match="screen">
<xsl:variable name="texto"><xsl:value-of
select="substring-before(.,xD)"/></xsl:variable>
<xsl:value-of select="concat($texto,'~\\')"/>
</xsl:template>
That works for the first 'xD' appearing but I can't find how to make it work
recursively for the whole content of the 'screen' text. (XSLT is not the best
thing to make strings replacements, I guess ;-) )
Could anyone help ?
Cheers
Phil
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| RE: [xsl] Multi-level grouping prob, mpfingstler | Thread | RE: [xsl] char replacement, Michael Leditschke |
| [xsl] Multi-level grouping problem., mpfingstler | Date | RE: [xsl] char replacement, Michael Leditschke |
| Month |