Q&A

Q1:Is it possible to use the <xsl:otherwise> element as the false alternative to an <xsl:if> element?
A1: No, the <xsl:otherwise> element is used inside an <xsl:choose> wrapper in conjunction with one or more <xls:when> elements.
Q2:If a JavaScript function is written using the <xls:script> tag, can it be placed inside a template if it's to be called from other templates?
A2: No. The <xls:script> tag is used to define global entities, so if you want the function to be globally accessible, it cannot be defined locally.
Q3:What's the main advantage of using a set of <xls:when> elements rather than a set of <xls:if> elements?
A3: The <xls:when> elements allow for the <xsl:otherwise> or "none of the above" option. Since the available options may ...

Get Sams Teach Yourself XML in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.