Re: Question about result tree fragments vs. node sets in parameters

Subject: Re: Question about result tree fragments vs. node sets in parameters
From: Gary L Peskin <garyp@xxxxxxxxxxxx>
Date: Sun, 27 Aug 2000 12:20:31 -0700
Jim --

The short answer is that the problem with your stylesheet is that, when
you use the document(..) function, it returns the _root node_ of the
requested document.  The XSLT processor will then attempt to execute the
apply-templates passing your step_data parameter.  Since you do not have
a template for the root node (/), the XSLT processor uses the built-in
template (xslt spec sec 5.8).  This, of course, doesn't have your
step_data parameter.  The default template for the root node just issues
an apply-templates on all of the children of the root node, namely on
the document element which in this case is the top_element.  Since this
template is invoked from the built-in template, it is invoked with no
parameters.  Therefore, your param in the top_element template is not
matched to any passed value since there is none.

To fix this problem, change your apply-templates select to 

	document('tree_error2.xml')/top_element.

What I find curious is that section 11.2 of the specification indicates
"If the variable-binding element has empty content and does not have a
select attribute, then the value of the variable is an empty string. 
This means that you should not be getting the "Can not convert
#RTREEFRAG to a NodeList!" message but a similar message for a #STRING. 
I'll look into this and let you know why you're getting what I think is
the wrong message.

Gary


jim hopp wrote:
> 
> I'm confused about when a parameter contains a result tree fragment and
> when it contains a node set.
>[snip]


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread