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

Re: Need help with using lookup table and string tran

Subject: Re: Need help with using lookup table and string translation
From: Dmitri Snytkine <d.snytkine@xxxxxxxxx>
Date: Tue, 12 May 2009 13:15:14 -0400
Re:  Need help with using lookup table and string  tran
I don't think I need to create any indexes because value of 'str'
attribute of tr_string is already unique. I think indexing makes sense
when values are not unique, then each key in index has node set as

And about the document(), yes, I am using the document() and tested it
with firefox, IE and even my iphone's browser displayed correct
result, so its good enough to me.

On Tue, May 12, 2009 at 10:50 AM, Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
> At 04:47 PM 5/11/2009, David wrote:
>> > The 'for in' looks like xslt2 function.
>> well an xpath2 expression, yes.
>> > for $x in key('tr_string-by-str', $key) return (x$/ru, $x/en, .)[1]
>> but you are in luck here as the for isn't actually doing anything in
>> that case you could write
>> key('tr_string-by-str', $key)/(ru,en, current())[1]
>> in xpath2
>> or in xslt1
>> <xsl:variable nae="x" select="key('tr_string-by-str', $key)"/>
>> <xsl:choose>
>>  <xsl:when test="$x/ru">
>>  <xsl:value-of select="$x/ru"/>
>>  </xsl:when>
>>  <xsl:when test="$x/en">
>>  <xsl:value-of select="$x/en"/>
>>  </xsl:when>
> The tricky thing here is where the 'tr_string-by-str' key retrieves its
> nodes.
> The matching elements ('tr_string'?) have to be somewhere. If they're not
> the source document, the stylesheet needs access to where they are. This
> requires, in XSLT 1.0, either the document() function (to call them in) or
> node-set() extension function (to make a variable declared in the
> into a node set that can be queried).
> At last report, the major browsers all supported document(), didn't they?
> Cheers,
> Wendell
> ======================================================================
> Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
> Mulberry Technologies, Inc.                http://www.mulberrytech.com
> 17 West Jefferson Street                    Direct Phone: 301/315-9635
> Suite 207                                          Phone: 301/315-9631
> Rockville, MD  20850                                 Fax: 301/315-8285
> ----------------------------------------------------------------------
>  Mulberry Technologies: A Consultancy Specializing in SGML and XML
> ======================================================================

Current Thread


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.
First Name
Last Name
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.