Parameter default value
This is an open discussion with 1 reply, filed under XSLT.
Search
Variables and parameters have scope, so you could set the variable inside a template, which will override the value that is set at the top level.
Also note that there is a slight difference in how processors handle variables v.s. parameters. Try experimenting with declaring it differently and see if the behaviour changes. I don’t quite remember what the rules are for libXSLT, but I believe declaring as parameters can override params sent to the processor as arguments while variables won’t.
Create an account or sign in to comment.
I’ve got a question regarding parameters: I see that
$url-
parameters are not set if they don’t have any value (makes sense).That way I can override their value using
at the top of my stylesheet.
But I’m having a problem with regular parameters. They’re always set but may be blank (you can see
$title = ''
in the debug view).This makes it impossible for me to override their value using said technique. Has anybody else had that problem too?