This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: SubString Issue!
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: RE: SubString Issue!
- From: Linda van den Brink <lvdbrink at baan dot nl>
- Date: Fri, 23 Jun 2000 12:52:43 +0200
- Reply-To: xsl-list at mulberrytech dot com
This works (with xt):
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="Highlight">
<B><xsl:apply-templates/></B>
</xsl:template>
<!--To apply mask:-->
<xsl:template match="text()[ancestor::CreditCard]"><!-- or
match="CreditCard/Highlight/text()" if credit card numbers are always inside
a Highlight element -->
<xsl:variable name="mask"><xsl:text>XXXX</xsl:text></xsl:variable>
<Text>
<xsl:value-of select="substring(., 1, 15)"/><!-- substring is used on the
current node -->
<xsl:value-of select="$mask"/>
</Text>
</xsl:template>
</xsl:stylesheet>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list