简体   繁体   中英

Error while executing the validation from xml file

I'm trying to execute a validation for validating an xbrl file. but getting following error.

Error on line 351 of *module with no systemId*:
XPST0017: Cannot find a matching 1-argument function named
{ http://www.xbrl.org/2010/function/formula }has-fallback-value()

XML File:

    <?xml version="1.0" encoding="utf-8"?>
<?taxonomy-version 1.0.4.0 ?> <?taxonomy-set-overall-version 2.8.0.0 ?>
<!--(C) EBA-->
<link:linkbase xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xbrli="http://www.xbrl.org/2003/instance" 
xmlns:xlink="http://www.w3.org/1999/xlink" 
xmlns:link="http://www.xbrl.org/2003/linkbase" 
xmlns:gen="http://xbrl.org/2008/generic" 
xmlns:label="http://xbrl.org/2008/label" 
xmlns:xff="http://www.xbrl.org/2010/function/formula"
xmlns:va="http://xbrl.org/2008/assertion/value" 
xmlns:eba_dim="http://www.eba.europa.eu/xbrl/crr/dict/dim" 
xmlns:eba_BA="http://www.eba.europa.eu/xbrl/crr/dict/dom/BA" 
xmlns:df="http://xbrl.org/2008/filter/dimension" 
xmlns:variable="http://xbrl.org/2008/variable" 
xmlns:eba_AP="http://www.eba.europa.eu/xbrl/crr/dict/dom/AP"
xmlns:eba_TR="http://www.eba.europa.eu/xbrl/crr/dict/dom/TR" 
xmlns:eba_PU="http://www.eba.europa.eu/xbrl/crr/dict/dom/PU" 
xmlns:eba_RF="http://www.eba.europa.eu/xbrl/crr/dict/dom/RF"
xmlns:eba_IM="http://www.eba.europa.eu/xbrl/crr/dict/dom/IM" 
xmlns:eba_CG="http://www.eba.europa.eu/xbrl/crr/dict/dom/CG" 
xmlns:eba_MC="http://www.eba.europa.eu/xbrl/crr/dict/dom/MC" 
xmlns:eba_BT="http://www.eba.europa.eu/xbrl/crr/dict/dom/BT" 
xmlns:eba_CS="http://www.eba.europa.eu/xbrl/crr/dict/dom/CS" 
xmlns:eba_CA="http://www.eba.europa.eu/xbrl/crr/dict/dom/CA" 
xmlns:eba_met="http://www.eba.europa.eu/xbrl/crr/dict/met" 
xmlns:xff="http://www.xbrl.org/2010/function/formula" 
xmlns:cf="http://xbrl.org/2008/filter/concept" 
xsi:schemaLocation="http://www.xbrl.org/2003/linkbase 
http://www.xbrl.org/2003/xbrl-linkbase-2003-12-31.xsd 
http://xbrl.org/2008/generic http://www.xbrl.org/2008/generic-link.xsd 
http://xbrl.org/2008/label http://www.xbrl.org/2008/generic-label.xsd 
http://xbrl.org/2008/assertion/value http://www.xbrl.org/2008/value-
assertion.xsd http://xbrl.org/2008/filter/dimension 
http://www.xbrl.org/2008/dimension-filter.xsd http://xbrl.org/2008/variable 
http://www.xbrl.org/2008/variable.xsd http://xbrl.org/2008/filter/concept 
http://www.xbrl.org/2008/concept-filter.xsd">
  <link:arcroleRef arcroleURI="http://xbrl.org/arcrole/2008/variable-filter" xlink:type="simple" xlink:href="http://www.xbrl.org/2008/variable.xsd#variable-filter" />
  <link:arcroleRef arcroleURI="http://xbrl.org/arcrole/2008/variable-set" xlink:type="simple" xlink:href="http://www.xbrl.org/2008/variable.xsd#variable-set" />
  <link:arcroleRef arcroleURI="http://xbrl.org/arcrole/2008/variable-set-filter" xlink:type="simple" xlink:href="http://www.xbrl.org/2008/variable.xsd#variable-set-filter" />
  <gen:link xlink:type="extended" xlink:role="http://www.xbrl.org/2003/role/link">
    <va:valueAssertion xlink:type="resource" xlink:label="eba_v6209_m" test="if (not(empty($a) or xff:has-fallback-value(QName('','a')))) then ($b &lt;= 12.5 * $c) else (true())" aspectModel="dimensional" implicitFiltering="true" id="eba_v6209_m" />
    <df:explicitDimension xlink:type="resource" xlink:label="eba_v6209_m.f1" id="eba_v6209_m.f1">
      <df:dimension>
        <df:qname>eba_dim:BAS</df:qname>
      </df:dimension>
      <df:member>
        <df:qname>eba_BA:x9</df:qname>
      </df:member>
    </df:explicitDimension>
    <variable:variableSetFilterArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set-filter" xlink:from="eba_v6209_m" xlink:to="eba_v6209_m.f1" complement="false" order="1" />
    <df:explicitDimension xlink:type="resource" xlink:label="eba_v6209_m.f2" id="eba_v6209_m.f2">
      <df:dimension>
        <df:qname>eba_dim:APR</df:qname>
      </df:dimension>
      <df:member>
        <df:qname>eba_AP:x27</df:qname>
      </df:member>
    </df:explicitDimension>
    <variable:variableSetFilterArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set-filter" xlink:from="eba_v6209_m" xlink:to="eba_v6209_m.f2" complement="false" order="2" />
    <df:explicitDimension xlink:type="resource" xlink:label="eba_v6209_m.f3" id="eba_v6209_m.f3">
      <df:dimension>
        <df:qname>eba_dim:TRI</df:qname>
      </df:dimension>
      <df:member>
        <df:qname>eba_TR:x4</df:qname>
      </df:member>
    </df:explicitDimension>
    <variable:variableSetFilterArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set-filter" xlink:from="eba_v6209_m" xlink:to="eba_v6209_m.f3" complement="false" order="3" />
    <df:explicitDimension xlink:type="resource" xlink:label="eba_v6209_m.f5" id="eba_v6209_m.f5">
      <df:dimension>
        <df:qname>eba_dim:PUR</df:qname>
      </df:dimension>
      <df:member>
        <df:qname>eba_PU:x0</df:qname>
      </df:member>
    </df:explicitDimension>
    <variable:variableSetFilterArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set-filter" xlink:from="eba_v6209_m" xlink:to="eba_v6209_m.f5" complement="false" order="4" />
    <df:explicitDimension xlink:type="resource" xlink:label="eba_v6209_m.f6" id="eba_v6209_m.f6">
      <df:dimension>
        <df:qname>eba_dim:REF</df:qname>
      </df:dimension>
      <df:member>
        <df:qname>eba_RF:x0</df:qname>
      </df:member>
    </df:explicitDimension>
    <variable:variableSetFilterArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set-filter" xlink:from="eba_v6209_m" xlink:to="eba_v6209_m.f6" complement="false" order="5" />
    <df:typedDimension xlink:type="resource" xlink:label="eba_v6209_m.f7" id="eba_v6209_m.f7">
      <df:dimension>
        <df:qname>eba_dim:IMI</df:qname>
      </df:dimension>
    </df:typedDimension>
    <variable:variableSetFilterArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set-filter" xlink:from="eba_v6209_m" xlink:to="eba_v6209_m.f7" complement="false" order="6" />
    <df:explicitDimension xlink:type="resource" xlink:label="eba_v6209_m.f22" id="eba_v6209_m.f22">
      <df:dimension>
        <df:qname>eba_dim:IMS</df:qname>
      </df:dimension>
      <df:member>
        <df:qname>eba_IM:x0</df:qname>
      </df:member>
    </df:explicitDimension>
    <variable:variableSetFilterArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set-filter" xlink:from="eba_v6209_m" xlink:to="eba_v6209_m.f22" complement="false" order="7" />
    <df:explicitDimension xlink:type="resource" xlink:label="eba_v6209_m.f23" id="eba_v6209_m.f23">
      <df:dimension>
        <df:qname>eba_dim:CLS</df:qname>
      </df:dimension>
      <df:member>
        <df:qname>eba_CG:x0</df:qname>
      </df:member>
    </df:explicitDimension>
    <variable:variableSetFilterArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set-filter" xlink:from="eba_v6209_m" xlink:to="eba_v6209_m.f23" complement="false" order="8" />
    <df:explicitDimension xlink:type="resource" xlink:label="eba_v6209_m.f24" id="eba_v6209_m.f24">
      <df:dimension>
        <df:qname>eba_dim:SCC</df:qname>
      </df:dimension>
      <df:member>
        <df:qname>eba_MC:x0</df:qname>
      </df:member>
    </df:explicitDimension>
    <variable:variableSetFilterArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set-filter" xlink:from="eba_v6209_m" xlink:to="eba_v6209_m.f24" complement="false" order="9" />
    <df:explicitDimension xlink:type="resource" xlink:label="eba_v6209_m.f25" id="eba_v6209_m.f25">
      <df:dimension>
        <df:qname>eba_dim:SUB</df:qname>
      </df:dimension>
      <df:member>
        <df:qname>eba_MC:x0</df:qname>
      </df:member>
    </df:explicitDimension>
    <variable:variableSetFilterArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set-filter" xlink:from="eba_v6209_m" xlink:to="eba_v6209_m.f25" complement="false" order="10" />
    <df:explicitDimension xlink:type="resource" xlink:label="eba_v6209_m.f26" id="eba_v6209_m.f26">
      <df:dimension>
        <df:qname>eba_dim:HYV</df:qname>
      </df:dimension>
      <df:member>
        <df:qname>eba_BT:x0</df:qname>
      </df:member>
    </df:explicitDimension>
    <variable:variableSetFilterArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set-filter" xlink:from="eba_v6209_m" xlink:to="eba_v6209_m.f26" complement="false" order="11" />
    <df:explicitDimension xlink:type="resource" xlink:label="eba_v6209_m.f27" id="eba_v6209_m.f27">
      <df:dimension>
        <df:qname>eba_dim:MCY</df:qname>
      </df:dimension>
      <df:member>
        <df:qname>eba_MC:x0</df:qname>
      </df:member>
    </df:explicitDimension>
    <variable:variableSetFilterArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set-filter" xlink:from="eba_v6209_m" xlink:to="eba_v6209_m.f27" complement="false" order="12" />
    <df:explicitDimension xlink:type="resource" xlink:label="eba_v6209_m.f28" id="eba_v6209_m.f28">
      <df:dimension>
        <df:qname>eba_dim:CSC</df:qname>
      </df:dimension>
      <df:member>
        <df:qname>eba_CS:x0</df:qname>
      </df:member>
    </df:explicitDimension>
    <variable:variableSetFilterArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set-filter" xlink:from="eba_v6209_m" xlink:to="eba_v6209_m.f28" complement="false" order="13" />
    <df:explicitDimension xlink:type="resource" xlink:label="eba_v6209_m.f29" id="eba_v6209_m.f29">
      <df:dimension>
        <df:qname>eba_dim:CCA</df:qname>
      </df:dimension>
      <df:member>
        <df:qname>eba_CA:x0</df:qname>
      </df:member>
    </df:explicitDimension>
    <variable:variableSetFilterArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set-filter" xlink:from="eba_v6209_m" xlink:to="eba_v6209_m.f29" complement="false" order="14" />
    <df:explicitDimension xlink:type="resource" xlink:label="eba_v6209_m.f30" id="eba_v6209_m.f30">
      <df:dimension>
        <df:qname>eba_dim:MRW</df:qname>
      </df:dimension>
      <df:member>
        <df:qname>eba_AP:x0</df:qname>
      </df:member>
    </df:explicitDimension>
    <variable:variableSetFilterArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set-filter" xlink:from="eba_v6209_m" xlink:to="eba_v6209_m.f30" complement="false" order="15" />
    <df:typedDimension xlink:type="resource" xlink:label="eba_v6209_m.f31" id="eba_v6209_m.f31">
      <df:dimension>
        <df:qname>eba_dim:INC</df:qname>
      </df:dimension>
    </df:typedDimension>
    <variable:variableSetFilterArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set-filter" xlink:from="eba_v6209_m" xlink:to="eba_v6209_m.f31" complement="true" order="16" />
    <df:typedDimension xlink:type="resource" xlink:label="eba_v6209_m.f32" id="eba_v6209_m.f32">
      <df:dimension>
        <df:qname>eba_dim:PBE</df:qname>
      </df:dimension>
    </df:typedDimension>
    <variable:variableSetFilterArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set-filter" xlink:from="eba_v6209_m" xlink:to="eba_v6209_m.f32" complement="true" order="17" />
    <df:typedDimension xlink:type="resource" xlink:label="eba_v6209_m.f33" id="eba_v6209_m.f33">
      <df:dimension>
        <df:qname>eba_dim:IRN</df:qname>
      </df:dimension>
    </df:typedDimension>
    <variable:variableSetFilterArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set-filter" xlink:from="eba_v6209_m" xlink:to="eba_v6209_m.f33" complement="true" order="18" />
    <df:typedDimension xlink:type="resource" xlink:label="eba_v6209_m.f34" id="eba_v6209_m.f34">
      <df:dimension>
        <df:qname>eba_dim:NED</df:qname>
      </df:dimension>
    </df:typedDimension>
    <variable:variableSetFilterArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set-filter" xlink:from="eba_v6209_m" xlink:to="eba_v6209_m.f34" complement="true" order="19" />
    <variable:factVariable xlink:type="resource" xlink:label="eba_v6209_m.a" bindAsSequence="false" fallbackValue="0" id="eba_v6209_m.a" />
    <cf:conceptName xlink:type="resource" xlink:label="eba_v6209_m.a.f4" id="eba_v6209_m.a.f4">
      <cf:concept>
        <cf:qname>eba_met:mi119</cf:qname>
      </cf:concept>
    </cf:conceptName>
    <variable:variableFilterArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-filter" xlink:from="eba_v6209_m.a" xlink:to="eba_v6209_m.a.f4" cover="true" complement="false" order="1" />
    <variable:variableArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set" xlink:from="eba_v6209_m" xlink:to="eba_v6209_m.a" name="a" order="1" />
    <variable:factVariable xlink:type="resource" xlink:label="eba_v6209_m.b" bindAsSequence="false" fallbackValue="0" id="eba_v6209_m.b" />
    <cf:conceptName xlink:type="resource" xlink:label="eba_v6209_m.b.f11" id="eba_v6209_m.b.f11">
      <cf:concept>
        <cf:qname>eba_met:mi310</cf:qname>
      </cf:concept>
    </cf:conceptName>
    <variable:variableFilterArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-filter" xlink:from="eba_v6209_m.b" xlink:to="eba_v6209_m.b.f11" cover="true" complement="false" order="1" />
    <variable:variableArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set" xlink:from="eba_v6209_m" xlink:to="eba_v6209_m.b" name="b" order="2" />
    <variable:factVariable xlink:type="resource" xlink:label="eba_v6209_m.c" bindAsSequence="false" fallbackValue="0" id="eba_v6209_m.c" />
    <cf:conceptName xlink:type="resource" xlink:label="eba_v6209_m.c.f18" id="eba_v6209_m.c.f18">
      <cf:concept>
        <cf:qname>eba_met:mi119</cf:qname>
      </cf:concept>
    </cf:conceptName>
    <variable:variableFilterArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-filter" xlink:from="eba_v6209_m.c" xlink:to="eba_v6209_m.c.f18" cover="true" complement="false" order="1" />
    <variable:variableArc xlink:type="arc" xlink:arcrole="http://xbrl.org/arcrole/2008/variable-set" xlink:from="eba_v6209_m" xlink:to="eba_v6209_m.c" name="c" order="3" />
  </gen:link>
</link:linkbase>

Exception thrown is:

net.sf.saxon.s9api.SaxonApiException: Cannot find a matching 1-argument function named { http://www.xbrl.org/2010/function/formula }has-fallback-value()

EDIT:
Saxon version is 9.3

XbrlExpressionProcessor class: constructor have following code:

net.sf.saxon.s9api.Processor saxonProcessor = new Processor(false);
net.sf.saxon.s9api.XQueryCompiler xqueryCompiler = saxonProcessor.newXQueryCompiler();
registerNamespaces(xqueryCompiler);

In registerNamespaces() method, xqueryCompiler.declareNamespace() is used to declare the namespaces.Here I have mentioned the namespace xff with URL http://www.xbrl.org/2010/function/formula .
In evaluateExpression() method

XQueryExecutable queryExecutable = xqueryCompiler.compile(toCompile.toString());    //This is the line which throws the error mentioned in the problem
XQueryEvaluator xqueryEvaluator = queryExecutable.load();
/*All the variable values are set in the xQueryEvaluator using
xqueryEvaluator.setExternalVariable(new QName(memberName), value)*/
XdmValue xqueryResult = xqueryEvaluator.evaluate();

StringBuilder object toCompile provides the all the functions definitions for Saxon processor.
It contains following data:

declare function iaf:sum($params as item()*) as item()+ {    let $facts := if (empty($params)) then (0) else one-or-more($params)  let $values := for $i in $facts return (iaf:splitValueThreshold($i)[1])  let $thresholds := for$iin $facts return (iaf:splitValueThreshold($i)[2])  let $sumValues := sum($values)  let $sumThresholds := sum($thresholds)  let $output := iaf:joinValueThreshold($sumValues, $sumThresholds)        return ($output)    };
declare function iaf:numeric-equal($paramA as item(), $paramB as item()) as xs:boolean {    let $itemA := iaf:splitValueThreshold($paramA)  let $itemB := iaf:splitValueThreshold($paramB) let $output := abs($itemA[1] - $itemB[1]) le ($itemA[2] + $itemB[2])        return ($output)};
declare function iaf:numeric-less-than($paramA as item(), $paramB as item()) as xs:boolean {    let $itemA := iaf:splitValueThreshold($paramA)  let $itemB := iaf:splitValueThreshold($paramB)  let $output := ($itemA[1] - $itemB[1]) lt ($itemA[2] + $itemB[2])        return ($output)     };
declare function iaf:numeric-less-equal-than($paramA as item(), $paramB as item()) as xs:boolean {    let $itemA := iaf:splitValueThreshold($paramA)  let $itemB := iaf:splitValueThreshold($paramB)  let $output := ($itemA[1] - $itemB[1]) le ($itemA[2] + $itemB[2])       return ($output)     };
declare function iaf:numeric-greater-than($paramA as item(), $paramB as item()) as xs:boolean {    let $itemA := iaf:splitValueThreshold($paramA)  let $itemB := iaf:splitValueThreshold($paramB)  let $output := $itemA[1] gt ($itemB[1] - ($itemA[2] + $itemB[2]))        return ($output)     };
declare function iaf:numeric-greater-equal-than($paramA as item(), $paramB as item()) as xs:boolean {    let $itemA := iaf:splitValueThreshold($paramA)  let $itemB := iaf:splitValueThreshold($paramB)  let $output := $itemA[1] ge ($itemB[1] - ($itemA[2] + $itemB[2]))       return ($output)     };
declare function iaf:numeric-add($paramA as item(), $paramB as item()) as item() {    let $itemA := iaf:splitValueThreshold($paramA)  let $itemB := iaf:splitValueThreshold($paramB)  let $value := $itemA[1]+$itemB[1]  let $threshold := $itemA[2]+$itemB[2]  let $output := iaf:joinValueThreshold($value,$threshold)        return ($output)     };
declare function iaf:numeric-subtract($paramA as item(), $paramB as item()) as item() {    let $itemA := iaf:splitValueThreshold($paramA)  let $itemB := iaf:splitValueThreshold($paramB)  let $value := $itemA[1]-$itemB[1]  let $threshold := $itemA[2]+$itemB[2]  let $output := iaf:joinValueThreshold($value,$threshold)        return ($output)     };
declare function iaf:numeric-divide($paramA as item(), $paramB as item()) as item() {    let $itemA := iaf:splitValueThreshold($paramA)  let $itemB := iaf:splitValueThreshold($paramB)  let $A := $itemA[1]  let $B := $itemB[1]  let $deltaA := $itemA[2]  let $deltaB := $itemB[2]  let $AdivB := $A div $B  let $J0 := ($A + $deltaA) div ($B + $deltaB)  let $J1 := ($A + $deltaA) div ($B - $deltaB)  let $J2 := ($A - $deltaA) div ($B + $deltaB)  let $J3 := ($A - $deltaA) div ($B - $deltaB)  let $threshold := max((abs($AdivB - $J0), abs($AdivB - $J1), abs($AdivB - $J2), abs($AdivB - $J3)))  let $output := iaf:joinValueThreshold($AdivB, $threshold)        return ($output)     };
declare function iaf:numeric-multiply($paramA as item(), $paramB as item()) as item() {  iaf:multiply-two-elements($paramA, $paramB)};
declare function iaf:numeric-multiply($params as item()+) as item() {    let $output := iaf:multiply-recursive($params, 1, 0)        return ($output)     };
declare function iaf:abs($input as item() as item() {    let $item := if (empty($input)) then 0 else $input  let $output := if ($item instance of element() and empty($item[2])) then    iaf:joinValueThreshold(abs($item), iaf-int:fact-threshold($item)) else (if (not($item instance of    element()) and empty($item[2]) and not(contains(string($item), ";"))) then    iaf:joinValueThreshold(abs($item), 0) else    iaf:joinValueThreshold(abs(xs:decimal(substring-before($item, ";"))),    xs:decimal(substring-after($item, ";"))))         return ($output)     };
declare function iaf:numeric-unary-minus($item as item()) as item() {    let $output := if ($item instance of element() and empty($item[2])) then    iaf:joinValueThreshold(-($item), iaf-int:fact-threshold($item)) else (if (not($item instance of    element()) and empty($item[2]) and not(contains(string($item), ";"))) then    iaf:joinValueThreshold(-($item), 0) else    iaf:joinValueThreshold(-(xs:decimal(substring-before($item, ";"))),    xs:decimal(substring-after($item, ";"))))         return ($output)     };
declare function iaf:min($params as item()*) as item() {    let $facts := if (empty($params)) then (0) else one-or-more($params)  let $values := for $i in $facts return (iaf:splitValueThreshold($i)[1])  let $thresholds := for $i in $facts return (iaf:splitValueThreshold($i)[2])  let $minValue := min($values)  let $indexMin := index-of($values, $minValue)[1]  let $minThreshold := $thresholds[$indexMin]  let $output := iaf:joinValueThreshold($minValue,$minThreshold)        return ($output)     };
declare function iaf:max($params as item()*) as item() {    let $facts := if (empty($params)) then (0) else one-or-more($params)  let $values := for $i in $facts return (iaf:splitValueThreshold($i)[1])  let $thresholds := for $i in $facts return (iaf:splitValueThreshold($i)[2])  let $maxValue := max($values)  let $indexMax := index-of($values, $maxValue)[1]  let $maxThreshold := $thresholds[$indexMax]  let $output := iaf:joinValueThreshold($maxValue,$maxThreshold)        return ($output)     };
declare function iaf:splitValueThreshold($item as item()) as item()+ {  let $valorUmbral := if ($item instance of element() and empty($item[2])) then ($item,    iaf-int:fact-threshold($item)) else (if (not($item instance of element()) and empty($item[2])   and not(contains(string($item), ";"))) then ($item, 0) else    (xs:decimal(substring-before($item, ";")), xs:decimal(substring-after($item, ";"))))        return ($valorUmbral)     };
declare function iaf:joinValueThreshold($value as item(), $threshold as item()) as xs:string {    let $output := concat(string($value),";",string($threshold))        return ($output)     };
declare function iaf:precision($item as item()+) as xs:decimal {    let $ouput := xfi:decimals($item)        return ($ouput)     };
declare function iaf:multiply-recursive($sequence as item()+, $count as item(), $subtotalParam as item()) as item() {    let $facts := if (empty($sequence)) then (0) else    one-or-more($sequence)  let $numberOfParams := count($facts)  let $subtotal := if ($count eq 1) then $facts[1] else $subtotalParam  let $multiply := if($count lt $numberOfParams) then iaf:multiply-two-elements($subtotal,    $facts[$count + 1]) else $subtotal  let $output := if($count lt $numberOfParams) then iaf:multiply-recursive($sequence,    ($count +1), $multiply) else $multiply        return ($output)     };
declare function iaf:multiply-two-elements($paramA as item(), $paramB as item()) as item() {    let $itemA := iaf:splitValueThreshold($paramA)  let $itemB := iaf:splitValueThreshold($paramB)  let $A := $itemA[1]  let $B := $itemB[1]  let $deltaA := $itemA[2]  let $deltaB := $itemB[2]  let $AxB := $A * $B  let $threshold := sum((abs($A * $deltaB), abs($B * $deltaA), $deltaA * $deltaB))        return (iaf:joinValueThreshold($AxB, $threshold))     };
declare function iaf:numeric-equal-threshold($paramA as item(), $paramB as item()) as item() {    let $itemA := iaf:splitValueThreshold($paramA)  let $itemB := iaf:splitValueThreshold($paramB)  let $output := ($itemA[2] + $itemB[2])        return ($output)     };
declare function iaf:numeric-less-than-threshold($paramA as item(), $paramB as item()) as item() {    let $itemA := iaf:splitValueThreshold($paramA)  let $itemB := iaf:splitValueThreshold($paramB)  let $output := ($itemA[2] + $itemB[2])        return ($output)     };
declare function iaf:numeric-less-equal-than-threshold($paramA as item(), $paramB as item() as item() {    let $itemA := iaf:splitValueThreshold($paramA)  let $itemB := iaf:splitValueThreshold($paramB)  let $output := ($itemA[2] + $itemB[2])        return ($output)     };
declare function iaf:numeric-greater-than-threshold($paramA as item(), $paramB as item()) as item() {    let $itemA := iaf:splitValueThreshold($paramA)  let $itemB := iaf:splitValueThreshold($paramB)  let $output := ($itemA[2] + $itemB[2])        return ($output)     };
declare function iaf:numeric-greater-equal-than-threshold($paramA as item(), $paramB as item()) as item() {    let $itemA := iaf:splitValueThreshold($paramA)  let $itemB := iaf:splitValueThreshold($paramB)  let $output := ($itemA[2] + $itemB[2])        return ($output)     };
declare function iaf:abs-sequence($params as item()*) as item()+ {    let $facts := if (empty($params)) then (0) else one-or-more($params)  let $values := for $i in $facts return (iaf:abs($i))        return (($values))     };
declare function iaf:numeric-equal-test($paramA as item(), $paramB as item()) as item()+ {    let $valueA := iaf:splitValueThreshold($paramA)[1]  let $valueB := iaf:splitValueThreshold($paramB)[1]  let $thA := iaf:splitValueThreshold($paramA)[2]  let $thB := iaf:splitValueThreshold($paramB)[2]  let $absol := abs($valueA - $valueB)  let $sumTh := $thA + $thB        return (($valueA, $valueB, $thA, $thB, $absol, $sumTh))     };
declare function iaf-int:exp10($power as xs:integer) as xs:decimal {  if ($power eq 0) then 1 else if ($power gt 0) then 10 * iaf-int:exp10($power - 1) else 1 div iaf-int:exp10(-$power)};
declare function iaf-int:fact-threshold($fact as item()) as xs:decimal {    let $decimals := xfi:decimals($fact)       return (if (string($decimals) = 'INF') then 0 else iaf-int:exp10(-xs:integer($decimals)) div 2)};
declare function xfi:decimals($fact as item() ) as item()+ { let $deci := $fact/@decimals  return ($deci)};
declare function xfi:fact-typed-dimension-value($fact as item() , $typedDim as xs:QName?) as xs:string {let $dimName := substring-before(substring-after($fact,concat("s2c_dim:",$typedDim,"__TDVALUE__")),";") return ($dimName)};
declare variable $a external; 
declare variable $b external; 
declare variable $c external; 
if (not(empty($a) or xff:has-fallback-value(QName('','a')))) then ($b <= 12.5 * $c) else (true())

In the above definition, the last 4 lines, we define the variables used in the test and the last line is the expression itself.

Please let me know if more information is needed or this helps.

I can't tell you what's wrong (because it's not the XML document you've shown us...) but I can suggest some diagnostic actions.

  1. You say you are executing "a validation" but it's not clear what you mean. Is this XSLT, XPath, XSD? We need to know what you are executing.

  2. Has this code ever worked in the past? If so, that's definite evidence that the problem is to do with the way you are running it: the most likely culprit being an incorrect class path.

  3. The name of the function {http://www.xbrl.org/2010/function/formula}has-fallback-value() is using an "abstract" URI rather than one that directly identifies a Java class (which would be something like {java:net.sf.xbrl.Formula}has-fallback-value() ). This means that Saxon is only going to be able to find it if it has been told where to look. The program you are running must be registering this extension with Saxon in some way. Find this code (or its documentation) and see how it might be failing.

  4. There's a Saxon configuration option to get diagnostic information on the loading of extension functions. On the XSLT command line it's -TJ, if you're using a Java API then it's the configuration property FeatureKeys.TRACE_EXTERNAL_FUNCTIONS. This shows you the steps Saxon is taking to locate a matching external function, which in turn shows you how far the search got before it failed: for example, whether it found a matching class but could not find a matching method. Given that this isn't a URI that directly identifies a Java class, I'm not optimistic this will reveal much, but it's worth a try.

  5. Check what version of saxon you are using, and see if that's consistent with the documentation of the application you are running.

I know I'm late to the party, but I'll try to be of value with my answer:

You're showing a single XML document that is part of the taxonomy from the European Banking Authority.

The validations you are trying to process are not XML, but XBRL. So in order to process these validations, you would need to know the XBRL specification and implement it. (Hint: The Saxon processor does not implement the XBRL spec.)

XBRL defines so-called "custom-functions". These are not part of standard XPath and are therefore not known by Saxon. (Or any other standard XPath processor out of the box.)

You would need to implement the custom functions and register them with Saxon for the processor to know where to find the 1-argument function named {http://www.xbrl.org/2010/function/formula}has-fallback-value() .

Unless you are actually trying to write your own XBRL Processor, I would advise you to download/buy an existing XBRL processor.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM