Parameter "numbers" you're passing to your template is passed as a string, so you could use number($rootFolder/node/@nodeName) to get around that. But, even if you'd pass this to your template, I still can't figure out what you're trying to do with it.. you're passing a single number and using a for-each to iterate... I don't see the relation here...
Could you elaborate on your content structure so we get a visual clue on what you're trying to achieve.
How to call template with list of numbers as parameter value
I writed template that return maxNumer.
But I can not call this template/ I can not send parameter as numbers list.
For example, the next code return error
The node names is years so it is number.
Hi AlexR,
Parameter "numbers" you're passing to your template is passed as a string, so you could use number($rootFolder/node/@nodeName) to get around that. But, even if you'd pass this to your template, I still can't figure out what you're trying to do with it.. you're passing a single number and using a for-each to iterate... I don't see the relation here...
Could you elaborate on your content structure so we get a visual clue on what you're trying to achieve.
Cheers,
/Dirk
Hi Dirk,
I want to pass list of years to selectMaxNumber template.
For example if I have next xml
I want to pass numbers "2009 2010" as list to parameter numbers.
And I want get 2010 as result of selectMaxNumber template.
The xpath expression "$rootFolder/node" pass correct nodes to template. But it pass nodes, not nodeNames.
I thinked that xpath expression "$rootFolder/node/@nodeName" will pass list of nodeNames (2009 2010), but it pass only first nodeName.
Why xpath expression "$rootFolder/node" pass list of nodes, but xpath expression "$rootFolder/node/@nodeName" pass only fist nodeName?
For example
xpath "$rootFolder/node[1]/@nodeName" return first nodeName.
xpath "$rootFolder/node[2]/@nodeName" return second nodeName.
so "$rootFolder/node/@nodeName" should return all nodeNames. But it doesn't.
I want pass list of nodeNames to template. How can I make it?
I know that I can rewrite selectMaxNumber template to select nodeName inside it. But I want to write universal template to select max number.
is working on a reply...