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

Empty String param

Subject: Empty String param
From: "Kerry, Richard" <richard.kerry@xxxxxxxxxxx>
Date: Wed, 2 Apr 2008 15:21:25 +0100
 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.


I get an error as follows :
XTTE0570: An empty sequence is not allowed as the value of parameter
$default.
Referring to the xsl:with-param line.

Why can't I pass in the empty string here ?
(ie why is it telling me that an empty sequence (should be a string) is
not allowed ?)

I have tried adding as="xs:string" to the xsl:with-param and also to the
xsl:param as I'd have thought that even though it may be the case that
the processor would reject an empty node-set or sequence if I was
passing one it should surely expect a string to be allowed to be empty.



Richard Kerry
Colledia Control Engineer
Siemens IT Solutions and Services Ltd
Room 457 Design Building, BBC Television Centre, Wood Lane, London, W12
7RJ
T: +44 (0)20 82259063 F: +44 (0)20 8576 8182 M: +44 (0)7921 244993
Email: richard.kerry@xxxxxxxxxxx
<blocked::mailto:richard.kerry@xxxxxxxxxxx>
Website:  www.siemens.co.uk/it-solutions
<blocked::outbind://47/www.siemens.co.uk/it-solutions>

This e-mail contains confidential information and is for the exclusive
use of the addressee/s.  If you are not the addressee, then any
distribution, copying or use of this e-mail is prohibited. If received
in error, please advise the sender and delete it immediately.  We accept
no liability for any loss or damage suffered by any person arising from
use of this e-mail.

Siemens IT Solutions and Services Limited
Registered No: 1203466 England
Registered Office: Faraday House, Sir William Siemens Square, Frimley,
Camberley, GU16 8QD

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

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-2007 All Rights Reserved.