xsl-list
[Top] [All Lists]

Re: [xsl] usage of entities (for dummies)

2006-08-03 03:03:02

Do i have to nest replace-functions for each of them in one
another like ...
<xsl:value-of select="replace(replace(., '\^12', '&ccedil;'), '\^13',
'&amp;')"/>
... or is there a more elegant solution for this?
in the most general case of course, nesting replace() calls is always an
option but here I suspect that you can do something like


<xsl:analayze-space select="." regex="\^([0-9]+)">
<xsl:matching-substring>
<xsl:value-of select="$replacements[number(regex-group(1))]"/>
<xsl:matching-substring>
<xsl:non-matching-substring>
<xsl:value-of select="."/>
</xsl:non-matching-substring>


together with something that makes $replacements a sequemce with  a
c-cedila in position 12
 eg

<xsl:variable name="replacements"  select="(
'a','b',...,'&#e7;', '&amp;')
"/>

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--