failure to parse eXist function in xquery
Posted: Mon Aug 13, 2012 7:57 pm
The error I get from oxygen is:
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
I use the same exist.jar file in the oxygen data source tool as I use on the eXist server.
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.F [Saxon-PE XQuery 9.4.0.3] Cannot find a matching 3-argument function named {http://exist-db.org/xquery/transform}transform()
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
The eXist funciton signatures are here: http://exist-db.org/exist/functions/transform/transform... <any/>,
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 = "http://www.local.com";
declare namespace xsl = "http://www.w3.org/1999/XSL/Transform";
declare namespace transform = "http://exist-db.org/xquery/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 {
string(transform:transform(
<any/>,
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:template match='/'>
<xsl:value-of select="format-number({$n},'{$s}')"/>
</xsl:template>
</xsl:stylesheet>,
()
))
};
let $cd := xs:dateTime(fn:current-date())
for $ss in
collection('/db/homer/2012/07')//sampleSet/site[@name='LCO']
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
return
<Record>
<When>{$sdt}</When>
<Ago>{$dif}</Ago>
{for $r in distinct-values($ss//Description/race)
let $N := count($ss//Description[race=$r])
order by $r descending
return <line>{$r} :: {$N} </line>}
</Record>