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

Translate and substring in AVT

Subject: Translate and substring in AVT
From: Jarkko.Moilanen@xxxxxx
Date: Tue, 11 Mar 2003 15:04:04 +0200
translate substring
Hi!

I am stuck with performing two operations one after the other.
First I need to translate all Capital letters to normal letters and 
then take a substring of the translation. Now in the below I am permorming 
only substring selection. The question is how to do the translation first?

XML: (dont blaim me about it =) )

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<FINCCIS>
<User>
  <FirstName>Topi</FirstName>
  <LastName>Testaaja</LastName>
  <Role>testaaja</Role>
  <Department>ITCM</Department>
  <Organization>Tay</Organization>

  <DateTime>Mon Feb 10 14:57:02 EET 2003</DateTime>
<UserProfile>
   <Lang>fi_Suomi.xml</Lang>
   <LogInName name="testaaja" active="y"/>
   <Services>
    <Service 
     name="SitDisp" 
     type="http" 
     address="itcm.uta.fi" 
     port=":8080" />
    <Service 
     name="XDoc" 
     type="http" 
     address="hypst09.uta.fi" 
     port=":6969" />
    <Service 
     name="Communication" 
     type="http" 
     address="itcm2.uta.fi" 
     port=":80" />

    <Service 
     name="Mail" 
     type="http" 
     address="itcm2.uta.fi/mail/" 
     port="" />
    <Service 
     name="Calendar" 
     type="http" 
     address="itcm2.uta.fi/STConf.nsf/vwCalendar?Openview&amp;Login" 
     port=":80" />
    <Service
      name="Ethnic" 
      type="http" 
      address="itcm.uta.fi" 
      port=":8080" />
   </Services>
   </UserProfile>
</User>
</FINCCIS>

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','abcdefghijklmnopqrstyvw')"/>
</xsl:for-each>

I can get testaaja, but still there is question how to combine 
these two functions inside AVT?


Cheers,
Jarkko

***************************************************
* Jarkko Moilanen                                 *
* Project Researcher, ITCM (www.itcm.org)         *
* Profound XML technology Expert                  *
* University of Tampere                           *
* Hypermedia Laboratory                           *
***************************************************

 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.