[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Empty String param

Subject: RE: Empty String param
From: "Houghton,Andrew" <houghtoa@xxxxxxxx>
Date: Wed, 2 Apr 2008 10:35:43 -0400
RE:  Empty String param
> From: Kerry, Richard [mailto:richard.kerry@xxxxxxxxxxx]
> Sent: 02 April, 2008 10:21
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  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.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.