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

using keys as cross-reference

Subject: using keys as cross-reference
From: Xiaocun Xu <xiaocunxu@xxxxxxxxx>
Date: Sun, 20 Jan 2002 07:38:08 -0800 (PST)
cross reference keys

  I am interested to implement cross-reference using
keys  (suggested by Jeni as well as documented in the
XSLT Programmer Reference 2nd Ed. on p.501-3).
  My situation is I have more readable headers in
Excel (i.e. *Organization Unique ID)that needs to be
translated into DTD attribute names (i.e.
OrganizationCode).  I intend to put the name-value
mapping in a separate XML, which I want to use keys to
retrieve the translation.
  I see two ways to accomplish this:
1. translates all the headers at the beginning of the
stylesheet into global variables.  This way, I do not
have to write user defined extensions.  The drawback
to this I lose extensibility, it will be difficult
when I also wish to translate values other than the
2. user defined extension to translate between name
and value on demand.
Are there other more effective solutions?
  Regarding solution #2 user defined extension, how to
pass the key into the extension since <xsl:key> has to
be top-level element?  With example on XSLT Programmer
Reference 2nd Ed. on p.502,
<xsl:key name="biog" match="author" use="@name"/>
In my extension function, can I directly use:
key('biog', $name)?

Much thanks,

Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!

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

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.