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

RE: Problem using variables with xpath -- simplified

Subject: RE: Problem using variables with xpath -- simplified query
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 5 Apr 2007 23:58:11 +0100
RE:  Problem using variables with xpath -- simplified
I'm always very reluctant to suggest it, but I think you could be hitting a
processor bug. Try to run the same thing with a different Java processor:
either Saxon, or the latest version of Xalan as distinct from the version
that comes bundled with the JDK.

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: Raghavan [mailto:raghavan479@xxxxxxxxx] 
> Sent: 05 April 2007 21:49
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Problem using variables with xpath -- simplified query
> 
> I am running into problem using a Variable inside a XPath. 
> I've placed my query as comments in the following XSL 
> 
> <?xml version='1.0' ?>
> <xsl:stylesheet
> xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
> version='1.0'>
> <xsl:output method='xml'/>
> 
> <!-- loading external file -->
> <xsl:variable name="doc2node"
> select="document('/prod/appl/Docs/metadata.xml')" />
> 
> <!-- var declaration for ' -->
> <xsl:variable name="apos" select='"&apos;"' />
> 
> <!-- The input XML has only one node with attr url="y"
> -->
> <xsl:variable name="pdfdoctitle"
> select="//somenodename/@url" />
> 
> <xsl:template match="/">
>   <TITLE>
>    <!-- The following block works in IDE like Stylus studio 
> or XMLSpy but not using a simple Java Transform code -->
>    <xsl:value-of
> select="$doc2node/documents/doc[@id=$pdfdoctitle]/@title"/>
> 
>    <!-- The following static compare works -->
>    <!--xsl:value-of
> select="$doc2node/documents/doc[@id='y']/@title"/-->
>   </TITLE>
> </xsl:template>
> </xsl:stylesheet>
> 
> Thanks,
> -Raghav
> 
> 
>  
> ______________________________________________________________
> ______________________
> The fish are biting. 
> Get more visitors on your site using Yahoo! Search Marketing.
> http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php

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.