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

Re: Using a custom variable derived from one XML file

Subject: Re: Using a custom variable derived from one XML file to search another and retrieve values of child nodes
From: Rob Newman <rlnewman@xxxxxxxx>
Date: Mon, 21 Jul 2008 08:13:56 -0700
Re:  Using a custom variable derived from one XML file
I understand that the template match needs to point to a new template. I will write that now. But how do I select on an attribute value that matches my custom defined variable $thisSta?

Thanks,
- Rob

On Jul 20, 2008, at 5:57 AM, Florent Georges wrote:

Rob Newman wrote:

Hi

<xsl:template match="station">
   <Placemark>
      <xsl:variable name="thisSta"><xsl:value-of select="@name" /></
xsl:variable>
      <name><xsl:value-of select="$thisSta" /></name>
      <xsl:template match="document( sources/source/@href, .)/
dataloggerlist/datalogger/@name=$thisSta">

This is not a correct XSLT snippet. You can't have embedded template rules. I guess you want rather a for-each, or an apply-templates + separated template rule.

Regards,

--drkm

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.