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

Re: Need help for XSL beautifaction

Subject: Re: Need help for XSL beautifaction
From: "Jon Gorman" <jonathan.gorman@xxxxxxxxx>
Date: Wed, 17 May 2006 12:55:36 -0500
Re:  Need help for XSL beautifaction
Hoped there was a way like this:
<xsl:copy-of select="${<xsl:copy-of select='textNo'/>}"/>

Are you asking if there's anything like keys? Yes, keys.


Check out the faq and the w3 docs for more details, but essentially
you can do this one path by having a "reference map" of sorts.

ie:
the xslt 1.0 way

map.xml
<textstrings>
<textstring id="text-1">Don't you love maps</textstring>
<texstring id="text-2">yes, yes I do</textstring>
</textstring>


in the xslt: <xsl:variable name="textstrings" select="document(map.xml)/textstrings" /> <xsl:key name="texts" match="$textstrings/textstring" use="@id"/>

then in the appropriate template

<xsl:value-of select="key('texts',@idref)" />

where idref would be the text-1, however it is set in the input tree.

There's a shorter way to do this in xslt 2.0, don't remember off the
top of my head.

Typed this in a hurry. Look in the faq for better info.


Jon Gorman


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-2011 All Rights Reserved.