Subject: Re: [xsl] Only output element when parameter value is not equal to blank (or null) From: Abel Braaksma <abel.online@xxxxxxxxx> Date: Thu, 01 Feb 2007 14:37:25 +0100 |
You can make your stylesheet miles simpler and shorter by
using a different approach. Instead of tons of parameters,
use something extensible, like an XML structure
It simplifies the stylesheet, yes, but it is not always what you want. You can want to provide a lot of parameters, settable from the command line interface of several processors, without requiring intalling other piece of software. In this case, defining (even a lot of) parameters taking only string values is what you want.
Regards,
--drkm
<xsl:param name="catalogName" /> <xsl:param name="productId" />
<xsl:variable name="key-settings"> <setting name="MASTERCATALOGNAME" value="{$catalogName}" /> <setting name="PRODUCTID" value="{$productId}" /> .... </xsl:variable>
<xsl:template match="/" > .....
<xsl:template match="setting[normalize-space(@value) != '']"> <Key name="{@name}" type="string"> <xsl:value-of select="@value" /> </Key> </xsl:template>
Cheers, -- Abel Braaksma
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Only output element when , Florent Georges | Thread | Re: [xsl] Only output element when , Florent Georges |
Re: [xsl] PARAMS and VARIABLES in X, Gerald Sheehan | Date | [xsl] Altova XSLT parser / was: PAR, Abel Braaksma |
Month |