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

RE: Translate and substring in AVT

Subject: RE: Translate and substring in AVT
From: Jarno.Elovirta@xxxxxxxxx
Date: Tue, 11 Mar 2003 15:24:32 +0200
xsl substring translate
Hi,

> I need to do both: translate and substring selection inside this 
> XSLT code bracked:
> 
> <xsl:for-each select="/FINCCIS/User/UserProfile/Services/Service">
> <xsl:variable name="position" select="position()"/>
> <xsl:if test="@name='Mail'">
> 
> <p><a href="{@type}://{@address}{@port}
> {substring(/FINCCIS/User/UserProfile/LogInName/@name,1,7)}.nsf
> " target="content">
> <img src="Email_program.gif" border="0" alt="foo"/>
> </a>
> 
> <br/>
> <b><a href="{@type}://{@address}{@port}
> {/FINCCIS/User/UserProfile/LogInName/@name}.nsf">
> <xsl:value-of select="document('lang_en_English.xml')
> /Language/Services/Service[$position]"/>
> </a>
> </b>	
> </p>
> </xsl:if>
>  ......
> ........ .
> ......
> more xsl:if 
> </xsl:for-each>
> 
> Now I know that with this separate 
> <xsl:for-each select="/FINCCIS/User/UserProfile/LogInName">
> <xsl:value-of select=
> "translate('TESTAAJA','ABCDEFGHIJKLMNOPQRSTYVW','abcdefghijklm
> nopqrstyvw')"/>
> </xsl:for-each>
> 
> I can get testaaja, but still there is question how to combine 
> these two functions inside AVT?

Why can't you just use

{substring(translate(/FINCCIS/User/UserProfile/LogInName/@name,'ABCDEFGHIJKLMNOPQRSTYVW','abcdefghijklmnopqrstyvw'),1,7)}

It would, also be worth saving 

  /FINCCIS/User/UserProfile/LogInName/@name

into a variable, already lower-cased.

Cheers,

Jarno - Neurotic Fish: Prostitute

 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.