Return node set from template (in another xslt file)
Hi
In XSLT file 1 I have a generic paging function that takes some parameters and finds the nodes to be displayed.
In XSLT file 2 I'd like to inlude xslt file 1 with the paging function, call file the 1 template to retrieve the nodes and then work on them in file 2.
Is that possible?
I tried to do something like this (actual paging logic excluded, replaced with GetXMLAll()):
In file 1:
In file 2:
But I get
System.Xml.Xsl.XsltException: Expression must evaluate to a node-set
on the for-each.
Any suggestion, solutions or ideas for other approaches would be extremely appriciated!
OK as I have discovered copy-of, I can now at least get the xml nodes as a string to the $nodes variable. Now I need to convert that string to a node set. I am sure I have seen this on the forum....
Return node set from template (in another xslt file)
Hi
In XSLT file 1 I have a generic paging function that takes some parameters and finds the nodes to be displayed.
In XSLT file 2 I'd like to inlude xslt file 1 with the paging function, call file the 1 template to retrieve the nodes and then work on them in file 2.
Is that possible?
I tried to do something like this (actual paging logic excluded, replaced with GetXMLAll()):
In file 1:
In file 2:
But I get
System.Xml.Xsl.XsltException: Expression must evaluate to a node-set
on the for-each.
Any suggestion, solutions or ideas for other approaches would be extremely appriciated!
Thanks!
OK as I have discovered copy-of, I can now at least get the xml nodes as a string to the $nodes variable. Now I need to convert that string to a node set. I am sure I have seen this on the forum....
Hi daniel_l,
Use node-set() function...
More info available here: http://www.xml.com/pub/a/2003/07/16/nodeset.html or perform a search for node-set in this forum
Regards,
/Dirk
Yes I have tried the following
and then it does not throw an error, but I still cannot seem to iterate the sub nodes.
Well, it did not work on the string returned from GetXMLAll, but it worked on the actual code I was going to use!
In the template with the paging function I do something like this, and the node-set function works on the resulting string.
Thanks a lot! :)
is working on a reply...