xml editor

Supported platforms

Compatible with Windows7 & Mac OS X Snow Leopard

Ready for data server software
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] [XSL] Calculating Length of String Variables


Subject: [xsl] [XSL] Calculating Length of String Variables
From: "Alice Wei" <ajwei@xxxxxxxxxxx>
Date: Wed, 12 Sep 2007 22:38:19 -0400

Hi,

 I am trying to create different sets of output based on the length of the
"string" of my variable. Below are the lines I used for calculation:

 <xsl:variable name="image_src">
        <xsl:value-of select="./@url"/>
    </xsl:variable>

 <xsl:template match="graphic">
        <xsl:value-of select="string-length($image_src)"/>
</xsl:template>


If I have XML like: <graphic url="0125"/>. the result is supposed to come out
with 4. And, likewise, <graphic url="123456"/> should come out with 6.
However, when I run the XSLT, it only gives me "0". Is there something I have
done wrong?

Thanks to those who may help.

Alice


Current Thread
Keywords
XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2011 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>®XML Editor