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

Re: how to evaluate a dyna generated variable?

Subject: Re: how to evaluate a dyna generated variable?
From: Andrey Solonchuk <solo@xxxxxxx>
Date: Mon, 8 Sep 2003 12:51:44 +0300
yahoo.com.ch
Hello Cao,

Monday, September 8, 2003, 11:35:07 AM, you wrote:

CH> Hello,
CH>   I have defined the I18n resources with variables like this:
CH> <xsl:variable name="lang.type.participant.1" select="'Absolute Relation'"/>
CH> <xsl:variable name="lang.type.participant.2" select="'Relative Relation'"/>
CH> <xsl:variable name="lang.type.participant.3" select="'Group Expression'"/>

CH> and in my stylesheet, I want to get the resource like this:
CH> <xsl:value-of
CH> select="exsl:evaluate(concat('$lang.type.participant.',Type))">
CH> but it seems exsl:evaluate only accept variables that contain XPath
CH> reference,right? then is there any way to do this?

CH> Thanks
CH> Max Cao

Hi.

I can't answer your question but for your situation you can
try following way, using document() function.

<?xml version="1.0" encoding="Windows-1251"?>
<xsl:stylesheet
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:java="http://xml.apache.org/xslt/java"
                xmlns:my="http://myurl"
                exclude-result-prefixes="java my"
                version="1.0">
<xsl:output method="html" indent="yes"/>

<my:root>
   <lang.type.participant id="1">Absolute Relation</lang.type.participant>
   <lang.type.participant id="2">Relative Relation</lang.type.participant>
   <lang.type.participant id="3">Group Expression</lang.type.participant>
</my:root>

<xsl:template match="root">
        <xsl:value-of select="document('')//my:root/*[@id=1]/text()"/>
        <xsl:value-of select="document('')//my:root/*[@id=2]/text()"/>
        <xsl:value-of select="document('')//my:root/*[@id=3]/text()"/>
</xsl:template>

</xsl:stylesheet>



CH> _________________________________________________________
CH> Do You Yahoo!? 
CH> 启用电邮帐号,领会雅虎通[身临其境聊电影]的动感魅力,还有网络摄像头+雅虎通收音机等你来拿
CH> http://cn.rd.yahoo.com/mail_cn/tag/?http://cn.messenger.yahoo.com

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



-- 
Best regards,
 Andrey                            mailto:solo@xxxxxxx


 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.