Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xsl] Empty String param

From: "Houghton,Andrew" <houghtoa@-------->
To:
Date: 4/2/2008 2:36:00 PM
> From: Kerry, Richard [mailto:richard.kerry@xxxxxxxxxxx]
> Sent: 02 April, 2008 10:21
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] Empty String param
>
>
> I want to declare an xsl parameter which is a string, and may
> be empty when called.
> The system doesn't seem to allow me to do this.
> I'm using Saxon-9.
>
> I say
>
> <xsl:template name="insert">
> <xsl:param name="default" />
> <!-- various stuff using $default-->
> </xsl:template>
>
> And eventually I do
> <xsl:call-template name="insert">
> <xsl:with-param name="default"
> select="$named-nodes[1]/@default" /> </xsl:call-template>
>
> So that I can get the value of default from an atribute in
> another document ($named-nodes).
> This attribute may be, and often is, absent.  In which case
> I'd expect default to be an empty string. Which it is for this test.
>

You need to change your parameter definition to:

<xsl:param name="default" as="xsd:string?"/>

which says that $default can be a string or absent.


Andy.


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent