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

RE: [XSL] Calculating Length of String Variables

Subject: RE: [XSL] Calculating Length of String Variables
From: Alice Ju-Hsuan Wei <ajwei@xxxxxxxxxxx>
Date: Thu, 13 Sep 2007 07:22:46 -0400
RE:  [XSL] Calculating Length of String Variables
Thanks to Michael and Jing. This part is now working and prints out the "value of the string length" accurately.

However, when I tried to use the node with the result of "123456," it prints out the "string-length" as a 6 preperly. But when I try to run a "test" of action according to this result, it does not perform any of the actionsth as in <xsl:when test="string-length($image_src_ ='6'">, but performs the actions as in <xsl:when-test="string-length($image_src)='4' or '5'"> as shown below:

<xsl:when test="string-length($image_src) = '4' or '5'">
<img>
<xsl:attribute name="src">images/<xsl:value-of select="./@url"/>.gif</xsl:attribute>
<xsl:attribute name="alt"> Picture No. <xsl:value-of select="./@url"/>
</xsl:attribute>
</img>
</xsl:when>
<xsl:when test="string-length($image_src) = '6' ">
<img>
<xsl:attribute name="src">images/<xsl:value-of select="substring($image_src,1,4)"
/>.gif</xsl:attribute>
<xsl:attribute name="alt"> Picture No. <xsl:value-of select="substring($src,1,4)"/>
</xsl:attribute>
</img>
</xsl:when>


Does anyone know if there is something I should have done that I have not?

Thank again.

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.