[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

SubString Issue!

Subject: SubString Issue!
From: "Chowdhury, Anisuzzaman" <Anisuzzaman.Chowdhury@xxxxxxxxxxxxx>
Date: Thu, 22 Jun 2000 11:16:42 -0500
masking xsl
Part of the XML data:

<CreditCard><Highlight>9999-9999-9999-9999</Highlight></CreditCard>
<Name>Jennifer <Highlight>Anniston</Highlight></Name>
<Date.of.Birth>10-06-1969</Date.of.Birth>

I would like to replace all the "Highlight" tags with "B" and mask the last
four digits of the credit card number.

Here are the templates I've created:

To replace "Highlight" with "B":

<xsl:template match="Highlight">
<B><xsl:apply-templates/></B>
</xsl:template>

To apply mask:

<xsl:template name="CreditCard">
<xsl:variable name="mask"><xsl:text>XXXX</xsl:text></xsl:variable>
<Text>
<xsl:value-of select="substring(CreditCard/text(), 1, 15)"/><xsl:value-of
select="$mask"/>
</Text>
</xsl:template>

Whenever I try to run this stylesheet on eXcelon Stylus XSLT processor, I
get an error message saying "Out of bounds arguments to substring function".


Using SAX parser, I get the following output:
<Text>XXXX</Text>

The problem is, "Highlight" tag can be anywhere. Is there any way I can get
the following output:

<Text><B>9999-9999-9999-XXXX</B></Text>
........................................................................

I would highly appreciate your suggestions.

Thanks,
Anis Chowdhury


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.