Page 1 of 1

failure to parse eXist function in xquery

Posted: Mon Aug 13, 2012 7:57 pm
by Lurker
The error I get from oxygen is:
F [Saxon-PE XQuery] Cannot find a matching 3-argument function named {}transform()

The same query works as expected when pasted into the eXist sandbox, or run by a perl XMLRPC tool using the same query file as specified for the oxygen editor.

I'm having trouble understanding what the problem might be with the saxon parser(s)(I've tried all three).

I'm using oxygen 14 and eXist 1.4.2.

My query is shown at the bottom, below. The line flagged as the error is the one that goes
... <any/>,

The eXist funciton signatures are here:

I use the same exist.jar file in the oxygen data source tool as I use on the eXist server.

Code: Select all

declare namespace local     = "";
declare namespace xsl       = "";
declare namespace transform = "";

declare function local:total-hours-from-duration
  ( $duration as xs:dayTimeDuration? )  as xs:decimal? {
   $duration div xs:dayTimeDuration('PT1H')
 } ;

declare function local:format-number($n as xs:decimal ,$s as xs:string) as xs:string {
      <xsl:stylesheet xmlns:xsl="" version="2.0">
         <xsl:template match='/'>
            <xsl:value-of select="format-number({$n},'{$s}')"/>

let $cd := xs:dateTime(fn:current-date())

for $ss in
  let $sdt := dateTime(xs:date($ss/../../@sampleDate),xs:time($ss/../@time))
  let $dif := local:format-number(local:total-hours-from-duration($cd - $sdt), "#,###0.00#" )

  order by $dif descending

    {for $r in distinct-values($ss//Description/race)
       let $N := count($ss//Description[race=$r])
       order by $r descending
         return <line>{$r} :: {$N} </line>}

Re: failure to parse eXist function in xquery

Posted: Mon Aug 13, 2012 9:34 pm
by ionela

Note that transform:transform function from your XQuery file is an eXist function and Saxon engine does not recognize eXist functions.

To execute the eXist XQuery in oXygen you should use the eXist connection as the XQuery processor. To do this, you need to configure a transformation scenario (Document -> Transformation-> Configure Transformation Scenario) and choose the eXist connection in the "Transformer" combo box.


Re: failure to parse eXist function in xquery

Posted: Thu Aug 23, 2012 11:48 pm
by Lurker
Thanks, I'll give that a try.