RE: [xsl] Parameter passing through call to "document"

Subject: RE: [xsl] Parameter passing through call to "document"
From: "William Scarvie" <wscarvie@xxxxxxxxxxx>
Date: Thu, 16 Mar 2006 22:37:24 -0800
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