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

RE: Parameter passing through call to "document"

Subject: RE: Parameter passing through call to "document"
From: "William Scarvie" <wscarvie@xxxxxxxxxxx>
Date: Thu, 16 Mar 2006 22:37:24 -0800
parameter passing through xquery
Charles Knell wrote:

You have a template that matches "/projects". In this template you do an
apply-templates and attempt to pass a parameter named "project_id". The value
you assign to this parameter appears to be a node named "record_id_". There is
your problem. This construct assumes an XPath structure of
"/projects/record_id_", where in the actual document the XPath is
"/projects/record/record_id_".


When you assign "/projects/record_id_" to the value of the parameter, you are
selecting a node that doesn't exist. Ergo, you get the default value of the
parameter.

Actually, because that call is within a xsl:for-each that selects on "record," I think I'm actually getting /projects/record/record_id.


In fact, if you'll have a look at the debugging output I put in just before the xsl:apply-templates call, you'll see that I'm printing out the value-of "record" in the current context. I do, in fact, get the value of each "record_id_" tag here. And, if I change the code to select nodes from the current context as the argument to xsl:apply-templates, the value gets passed in correctly in the parameter.

It's only when I change the select to use the document call that the parameter fails to pass correctly.

Thanks,

Will

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.