我正在尝试执行验证以验证xbrl文件。但出现以下错误。
*没有系统ID *的模块的第351行出现错误:
XPST0017:找不到名为1
的匹配的1参数函数 {http://www.xbrl.org/2010/function/formula}具有fallback-value()
XML文件:
<?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 <= 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>
引发的异常是:
net.sf.saxon.s9api.SaxonApiException:找不到名为{http://www.xbrl.org/2010/function/formula}的匹配1参数函数has-fallback-value()
编辑:
Saxon版本是9.3
XbrlExpressionProcessor
类:
构造函数具有以下代码:
net.sf.saxon.s9api.Processor saxonProcessor = new Processor(false);
net.sf.saxon.s9api.XQueryCompiler xqueryCompiler = saxonProcessor.newXQueryCompiler();
registerNamespaces(xqueryCompiler);
在registerNamespaces()
方法中,xqueryCompiler.declareNamespace()
用于声明名称空间。这里我提到了URL为 http://www.xbrl.org/2010/function/formula 的名称空间xff
。 br />
在evaluateExpression()
方法中
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对象toCompile
提供了Saxon处理器的所有功能定义。
它包含以下数据:
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())
在上面的定义的最后4行中,我们定义了测试中使用的变量,最后一行是表达式本身。
请让我知道是否需要更多信息或有帮助。
答案 0 :(得分:1)
我无法告诉您出了什么问题(因为这不是您向我们展示的XML文档...),但是我可以建议一些诊断措施。
您说您正在执行“验证”,但不清楚您的意思。这是XSLT,XPath,XSD吗?我们需要知道您正在执行什么。
此代码过去曾经有用吗?如果是这样,则有确凿的证据表明问题与您的运行方式有关:最可能的罪魁祸首是错误的类路径。
函数{http://www.xbrl.org/2010/function/formula}has-fallback-value()
的名称使用的是“抽象” URI,而不是直接标识Java类的URI(类似于{java:net.sf.xbrl.Formula}has-fallback-value()
)。这意味着撒克逊人只有在被告知要看的地方时才能找到它。您正在运行的程序必须以某种方式向Saxon注册此扩展。找到此代码(或其文档),看看它可能如何失败。
有一个Saxon配置选项,可获取有关扩展功能加载的诊断信息。在XSLT命令行上,它是-TJ,如果您使用的是Java API,则它是配置属性FeatureKeys.TRACE_EXTERNAL_FUNCTIONS。这向您显示了Saxon为查找匹配的外部函数而采取的步骤,该步骤又向您显示了搜索在失败之前走了多远:例如,搜索是否找到了匹配的类但找不到匹配的方法。鉴于这不是直接标识Java类的URI,因此我对此并不乐观,但值得一试。
检查您正在使用的saxon版本,并查看其是否与您正在运行的应用程序的文档一致。
答案 1 :(得分:0)
我知道我参加晚会很晚,但是我会尽力让自己的回答有价值:
您正在显示的是欧洲银行管理局分类法中的一个XML文档。
您要处理的验证不是XML,而是XBRL。因此,为了处理这些验证,您需要了解XBRL规范并加以实施。 (提示:Saxon处理器未实现XBRL规范。)
XBRL定义了所谓的“自定义功能”。这些不是标准XPath的一部分,因此Saxon不知道。 (或其他任何现成的标准XPath处理器。)
您需要实现自定义功能,并向Saxon注册它们,以便处理器知道在哪里可以找到1-argument function named
{http://www.xbrl.org/2010/function/formula}has-fallback-value()
。
除非您实际上正在尝试编写自己的XBRL处理器,否则我建议您下载/购买现有的XBRL处理器。