This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: SubString Issue!


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]