Re: [xsl] A beef with XSLT Sometimes too complicated

Subject: Re: [xsl] A beef with XSLT Sometimes too complicated
From: Kamal Bhatt <kbhatt@xxxxxxxxx>
Date: Fri, 14 Jul 2006 15:42:04 +1000
In this case, you can do without the xsl:text:

<xsl:variable name="bg_img">
<xsl:choose>
<xsl:when test="normalize-space($all_vars)=''">background_bright</xsl:when>
<xsl:otherwise>background_faded</xsl:otherwise>
</xsl:choose>
</xsl:variable>

I too am annoyed by the syntax. My pet peev is that xsl:attribute has to be the first element. This is really annoying if you want to optionally add an attribute.


<xsl:variable name="bg_img">
<xsl:choose>
<xsl:when test="normalize-space($all_vars)=''">
<xsl:text>background_bright</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>background_faded</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>

Is there a cleaner / simpler way to do this?  Any chance you can do
this in one line?

Karl..




--
Kamal Bhatt


-- Disclaimer: This email is confidential and may contain privileged information for the sole use of the person or business to which it is addressed. If you are not the intended recipient, please notify the sender by return e-mail or phone as you must not view, disseminate, distribute or copy this email without our consent. We do not accept any liability in connection with any computer virus, data corruption, incompleteness, or unauthorised amendment of this email. It is the sole responsibility of the receiver to scan for viruses before opening.

Current Thread