I want to return a value from a template(getIdList)
templates never return values (in the sense of a function
return). Anything they generate is always added to the current output
(whetehr that is the stylesheet result, or a variable).
You haven't said what ypur input looks like, or what output ypiu want or
what transform you are trying to do, so I can make some comments on the
code you posted but can't really suggest any code that you need,
although I make a blind guess at the end.
<xsl:call-template select="/root/vid" name="getIdList" />
This is a syntax error you can not have a select attribute on
call-template so you should get no output. If you delete that then
it generates a variable idList with a document node with child nodes
anything generated by getIdList, it then discards any nodes in that
variable and outputs the string value of $idList.
doing a for-each over a single node is a no-op, so it is like not having
the for-each except that variable definitions have skope the current
element so it restricts the scope of $idList"
there is no variable $var in scope at this point (you haven't defined
var yet) What processor are you using, again this should have given you
a syntax error and no output.
if the definition of $var had been syntactivcally correct, it would have
gone out of scope at this point.
so this is a reference to an undefined variable.
I suspect that what you want is
or, in xslt2
<xsl:value-of select="vid" separator=","/>
With no variables at all
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.
This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>