So the templates replace the choose element? and the priority attribute with -1 behaves as the otherwise element?
And I was trying with seperating the doctypes with | .. I guess I still need to wrap the <xsl:apply-templatesselect="$currentPage[normalize-space(umbHeadline)]"/> inside the $currentPage/umbHeadline != '' test..
No, the normalize-space() function is already ensuring that templates are applied to the $currentPage only if there is content in the umbHeadline element, so the if-statement is no longer necessary.
As the name implies, normalize-space() normalizes whitespace in the node by stripping away leading and trailing whitespace (among other things). If there is still content left after the normalization, the predicate returns true(), and the templates are applied. Chriztian explained it quite well midway through this comment :)
Shorten test on multiple doc types
Hi..
I have a simple set of multiple doctypes in the test condition in a choose element:
Is there an easier way to summarize the line:
Bjarne
Hi Bjarne,
Yes - use templates :-)
/Chriztian
Hi Chriztian..
Thanks..
So the templates replace the choose element? and the priority attribute with -1 behaves as the otherwise element?
And I was trying with seperating the doctypes with | ..
I guess I still need to wrap the <xsl:apply-templatesselect="$currentPage[normalize-space(umbHeadline)]"/> inside the $currentPage/umbHeadline != '' test..
Bjarne
No, the normalize-space() function is already ensuring that templates are applied to the $currentPage only if there is content in the umbHeadline element, so the if-statement is no longer necessary.
As the name implies, normalize-space() normalizes whitespace in the node by stripping away leading and trailing whitespace (among other things). If there is still content left after the normalization, the predicate returns true(), and the templates are applied. Chriztian explained it quite well midway through this comment :)
Okay.. thanks for your explanation Dan ..
Now I know that :)
Bjarne
is working on a reply...