I have raised the issue that we need an xs:numeric type and that all
F&O-s currently working with xs:double should be redefined to have
xs:numeric in their signatures.
Not sure if this is realistic even for XPath 3.0, but cant we, in the
"meantime" have a nice
saxon:numeric
type?
Just a thought...
--
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
Never fight an inanimate object
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play
On Mon, Jul 21, 2008 at 7:33 PM, Michael Kay <mike@...> wrote:
> I've created a patch for Saxon 9.0 and 9.1 and will post it as soon as I get
> online.
>
> The problem occurs with any arithmetic expression in backwards compatibility
> mode where the static type of one of the operands is "numeric" (and not a
> specific numeric type). This is the case for sum(/a/b/c) where c is known to
> be untypedAtomic (the expression works in Saxon-SA, curiously, because less
> type information is available in that case - c might be of type duration, so
> the inferred type for sum() is anyAtomicType, which works OK.)
>
> The reason that the inferred type is "numeric" rather than xs:double is that
> sum() is defined to return the integer zero when the argument is an empty
> sequence.
>
> Michael Kay
> http://www.saxonica.com/
>
>> -----Original Message-----
>> From: saxon-help-bounces@...
>> [mailto:saxon-help-bounces@...] On Behalf
>> Of David Carlisle
>> Sent: 20 July 2008 23:41
>> To: saxon-help@...
>> Subject: [saxon] Arithmetic operator is not defined for
>> arguments of types(numeric, xs:double)
>>
>>
>> Michael,
>>
>> I've a horrible feeling that this is going to be user-error but...
>>
>> The transform below if run with saxon 8.9J produces
>>
>>
>> $ saxon8 test.xml test.xsl
>> Warning: at xsl:stylesheet on line 2 of
>> file:/C:/cygwin/home/mml2tex/test.xsl:
>> Running an XSLT 1.0 stylesheet with an XSLT 2.0 processor
>> <?xml version="1.0" encoding="UTF-8"?>3
>>
>> which is what I exected.
>>
>>
>> If run with Saxon 9.1.0.1J then it produces no output and
>> gives the error
>>
>> $ saxon9 test.xml test.xsl
>> Warning: at xsl:stylesheet on line 2 column 52 of test.xsl:
>> Running an XSLT 1.0 stylesheet with an XSLT 2.0 processor
>> Error at xsl:template on line 4 column 42 of test.xsl:
>> XPTY0004: Arithmetic operator is not defined for arguments
>> of types (numeric, xs:double) Failed to compile stylesheet. 1
>> error detected.
>>
>>
>> If I change the version= attribuute to 2.0 instead of 1.0
>> then saxon 8
>> and 9 give the same result
>>
>> $ saxon9 test.xml test.xsl
>> <?xml version="1.0" encoding="UTF-8"?>3
>>
>>
>>
>>
>> test.xsl
>> <xsl:stylesheet version="2.0"
>> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>>
>> <xsl:template match="apply" priority="1">
>> <xsl:value-of select="sum(bvar/degree)+count(bvar[not(degree)])"/>
>> </xsl:template>
>>
>> </xsl:stylesheet>
>>
>>
>>
>> test.xml
>> <apply>
>> <partialdiff/>
>> <bvar>
>> <ci>x</ci>
>> <degree>
>> <cn>2</cn>
>> </degree>
>> </bvar>
>> <bvar>
>> <ci>y</ci>
>> </bvar>
>> </apply>
>>
>>
>>
>> David
>>
>>
>>
>> ______________________________________________________________
>> __________
>> The Numerical Algorithms Group Ltd is a company registered in England
>> and Wales with company number 1249803. The registered office is:
>> Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.
>>
>> This e-mail has been scanned for all viruses by Star. The service is
>> powered by MessageLabs.
>> ______________________________________________________________
>> __________
>>
>> --------------------------------------------------------------
>> -----------
>> This SF.Net email is sponsored by the Moblin Your Move
>> Developer's challenge
>> Build the coolest Linux based applications with Moblin SDK &
>> win great prizes
>> Grand prize is a trip for two to an Open Source event
>> anywhere in the world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> _______________________________________________
>> saxon-help mailing list archived at http://saxon.markmail.org/
>> saxon-help@...
>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> saxon-help@...
> https://lists.sourceforge.net/lists/listinfo/saxon-help
>
|