W3C home > Mailing lists > Public > xproc-dev@w3.org > February 2012

Re: A case of superfluous type checking for parameters (p:with-param and xsl:param) ?

From: Norman Walsh <ndw@nwalsh.com>
Date: Thu, 16 Feb 2012 12:28:53 -0500
To: XProc Dev <xproc-dev@w3.org>
Message-ID: <m2ty2qznze.fsf@nwalsh.com>
Manfred Staudinger <manfred.staudinger@gmail.com> writes:
> Using XML Calabash, v1.0.2 (for Saxon 9.4.x). In my pipeline I have a
> p:xslt step with
>    <p:with-param name="scale" select="$scale"><p:empty/></p:with-param>
> where $scale is a required option from the command line. The parameter
> to be received in the XSLT is defined with
>    <xsl:param name="scale" as="xs:decimal"/>
> and this results in an error: "XPTY0004:Required item type of value of
> variable $scale is xs:decimal; supplied value has item type
> xs:string".

I was just looking at this bit of code the other day. Do you have the
allow-general-expressions extension enabled?

It sounds like a bug to me, if you can reproduce it with a small test
case and post it in the issue tracker


I'll fix it asap.

> Q1: Can Calabash drop this check?

It's not on purpose. :-)

> Q2: The best workaround for the user?

If you're using the general expressions extension, try casting explicitly
to xs:decimal yourself:

  <p:with-param name="scale" select="xs:decimal($scale)">...

If not, then I'm even more confused.

                                        Be seeing you,

Norman Walsh
Lead Engineer
MarkLogic Corporation
Phone: +1 413 624 6676

Received on Thursday, 16 February 2012 17:29:27 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:17:02 UTC