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

Variable creation & use problem

Subject: Variable creation & use problem
From: "cielo rosso" <cielorosso@xxxxxxxxx>
Date: Tue, 25 Jul 2006 14:30:49 -0700
cielo creation

I'm having problems creating a variable which I use as a parameter in
a template call.

What I'm trying to do: I want to parse a string containing ID's and
create a variable which contains the node that satisfy a given
condition whose ID is among those in the string. I want to pass this
variable as a parameter to a template call.

This is what I have:
[....] NOTE1: tokenize($list[1]/@DMDID returns something like "DMD1 DMRD1"
      NOTE2: There is only one node that satisfy the condition,
either the one with ID=DMD1 or ID=DMRD1,
                    I want to find which one and store it into a variable.

      <xsl:variable name="dmdnode">
           <!-- Find the mods nodes with the DM id's-->
           <xsl:for-each select="tokenize($list[1]/@DMDID, ' ')">
                   <xsl:value-of select="$doc//mets:dmdSec[@ID=current()]"/>
                   <xsl:call-template name="addAttributesAndFields">
                       <xsl:with-param name="doc" select="$doc"/>
                       <xsl:with-param name="type" select="$type"/>
                       <xsl:with-param name="dmdnode" select="$dmdnode"/>

If I just write out what the for-each creates, I get the correct
values, however, when I try to use the dmdnode variable, I get a node
containing an empty document fragment.

Thanks for your insight,


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.