2 of 2
2
HTML+XML or XSLT Sugar
Posted: 10 November 2011 09:51 PM   [ Ignore ]   [ # 16 ]
Newbie
Rank
Total Posts:  11
Joined  2011-01-30

xsl:when expands to

<xsl:when test=""/> 

xsl:choose + xsl:when is the equivalent of if, else if… like so

<xsl:choose>
    <
xsl:when test="">
        

    
</xsl:when>
    <
xsl:when test="">
        

    
</xsl:when>
    <
xsl:otherwise>
        

    
</xsl:otherwise>
</
xsl:choose

xsl:when will thus always contain the action to perform if the test matches, so should actually expand to

<xsl:when test=""></xsl:when

instead of the self-closing variant, so you can actually write inside the element the action to perform.

Profile
 
 
Posted: 10 November 2011 10:00 PM   [ Ignore ]   [ # 17 ]
Newbie
Rank
Total Posts:  11
Joined  2011-01-30

As a matter of fact, then, xsl:choose should probably expand to

<xsl:choose>
    <
xsl:when test="">
    </
xsl:when>
</
xsl:choose

since it is always going to contain at least an xsl:when element.

I do not know if there are other xsl elements that always will be followed by other specific elements, and if such a thing is contemplated in Espresso for other particular xsl elements’ expansion. I do not know, then, if what I propose above is coherent with how xsl expansion is approached to, generally, in Espresso.

Profile
 
 
   
2 of 2
2