W3C home > Mailing lists > Public > xproc-dev@w3.org > December 2009

[closed] Re: How to pass a boolean value true or false using with-param when the required param type is xs:boolean;

From: Norman Walsh <ndw@nwalsh.com>
Date: Thu, 17 Dec 2009 10:15:29 -0500
To: XProc Dev <xproc-dev@w3.org>
Message-ID: <m24onpbpim.fsf@nwalsh.com>
Alex Muir <alex.g.muir@gmail.com> writes:
> In the following xproc the <p:with-param name="preserve_newline"
> select="false()"/> gives me an error message
>
>  "Description: Required type is xs:boolean; supplied value has type
> xs:string"
>
> because the style sheet is expecting
>
> <xsl:param name="preserve_newline" as="xs:boolean"/>.
>
> It's funny to be asking this question but how do I specify the boolean
> value false in the xproc with-param ? I tried false, false() and 0 but
> there all treated as strings giving the same error message.

The WG discussed this at the 3 Dec 2009 telcon. Unfortunately, XProc
V1.0 defines all parameters as being of type "string" and XPath 2.0
doesn't provide automatic promotion of "string" values to any other
sort of value.

It's a nasty, unfortunate limitation in XProc 1.0, but I don't think
there's anything we can do about it.

The "solution" such as it is, is to change the stylesheet so that it
accepts a parameter containing a string. It can then compare that
string to "0" or "1" or "true" or "false" to determine the appropriate
boolean value.

Passing values on the command line (pre-XProc) is one of the reasons
why, for example, the DocBook XSLT stylesheets define all "boolean"
parameters as having the value "0" or "1" (as strings).

Please let us know if you're unsatisified by this resolution.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <ndw@nwalsh.com> | Life always comes to a bad end.--Marcel
http://nwalsh.com/            | Aymé

Received on Thursday, 17 December 2009 15:39:02 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 17 December 2009 15:39:02 GMT