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

Re: Re: How to pass search path as variable and get ba

Subject: Re: Re: How to pass search path as variable and get back node list.
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Wed, 27 Mar 2002 23:26:58 -0800 (PST)
get pass yahoo
"J.Pietschmann" <j3322ptm at yahoo dot de> wrote:

> Andrew Kerns wrote:
> > <xsl:param name="DATA_REQUEST_NAME"/>  
> > 
> > <xsl:variable name="ftype_search"
> > select="concat('//JOB_REQUEST/DATA_REQUEST
> [@NAME=',$DATA_REQUEST_NAME,']/FILE_TYPE')"/>

> You have assigned a string to the variable $ftype_search,
> and it will stay a string, even if it looks like an XPath
> expression. In most other languages, if you do
>    a="1 + 1";
>    b=a;
> you usually don't expect that b is 2 afterwards.
> 
> Your problem is much simpler to solve, try this:
>    <xsl:variable name="ftype_search"
>       select="//JOB_REQUEST/DATA_REQUEST
> [@NAME=$DATA_REQUEST_NAME]/FILE_TYPE"/>
> 
> If you really want to pass more complicated expressions
> as parameter values, like "1 + 1" or "/DATA_REQUEST
> [@NAME=$DATA_REQUEST_NAME]",
> search the manual for your processor for an evaluate()
> function

Instead of looking for a vendor:evaluate() function, a better approach
is to use DOM and change a skeleton stylesheet before the
transformation is applied, by setting the value of the "select"
attribute of a certain global variable to the string XPath expression
that is necessary to evaluate.

This is basically what the XPath Visualizer does all the time.

Cheers,
Dimitre Novatchev.




__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/

 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.