sajesh Posted September 21, 2006 Posted September 21, 2006 Is it possible in XSLT to return a value from a template to another where it is called from? Just like the return statement we use in C/JAVA methods.. can we do it in XSLT any way?
boen_robot Posted September 21, 2006 Posted September 21, 2006 When you call a template, you're invoking it and thus return a value from it in the output. That is the behaviour. I'm not sure what you're asking for here.I mean, if you already know templates could be called, you should know that for example: <xsl:template name="template1">1</xsl:template><xsl:template match="/">0<xsl:call-template name="template1"/></xsl:template> Will produce "01", scince "template1" outputs "1" and the main template returns "0" before "template1" is invoked.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now