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

Using a tree read with document() as a hash-table

Subject: Using a tree read with document() as a hash-table
From: Thorbjørn Ravn Andersen <TRA@xxxxxxxx>
Date: Wed, 14 Jun 2000 11:16:03 +0200
read input hash table
My problem is that I need to look up a value in another external XML file during XSLT processing, to include in the generated output.

I can read in the external file with the following lines

<xsl:param name="packtypefile" select="packtype.xml" />
<!-- Load the packtypes from the external file -->
<xsl:variable name="packtypetree" select="document(packtypefile)" saxon:trace="yes"/>

which is rather small and looks like

<ROWSET><!-- Warning:  This is not using approved tag names!  Beware-->
<ROW><id>0</id><packcode></packcode><ordertxt>%d</ordertxt><ssmtxt>%d</ssmtxt><modultxt>price each</modultxt></ROW>
<ROW><id>1</id><packcode>KT</packcode><ordertxt>1 Kit of %d</ordertxt><ssmtxt>1 kit</ssmtxt><modultxt>price per kit</modultxt></ROW>
<ROW><id>2</id><packcode>BAG</packcode><ordertxt>1 Bag of %d</ordertxt><ssmtxt>1 bag</ssmtxt><modultxt>price per bag</modultxt></ROW>
...


During the XSLT processing, I have the packcode as a subnode of the current node, and I need the corresponding value of the <modultxt> tag for output.

I have done a lot of trial-and-error, and have given up on the following


  <!-- First look up the packtype -->
  <xsl:apply-templates select="$packtypetree//ROW[packcode='GREEL']" mode="preview"/>

to get "into" the node-set of $packtypetree, but without visible results. 

I would appreciate a nudge in the right direction.  Am I on the right track?

Thanks in advance.
-- 
  Thorbjørn Ravn Andersen      "... plus ... Tubular Bells!"


 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.