代码之家  ›  专栏  ›  技术社区  ›  VijayD

从XML文件执行验证时出错

  •  0
  • VijayD  · 技术社区  · 6 年前

    我正在尝试执行验证XBRL文件的验证。但出现了以下错误。

    *模块第351行没有systemID*时出错:
    xpst0017:找不到名为的匹配单参数函数
    { http://www.xbrl.org/2010/function/formula }has-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 &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>
    

    引发的异常为:

    net.sf.saxon.s9api.saxonapiexception:找不到名为{ http://www.xbrl.org/2010/function/formula }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() 用于声明命名空间。这里我提到了命名空间 xff 带URL http://www.xbrl.org/2010/function/formula .
    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行,我们定义测试中使用的变量,最后一行是表达式本身。

    如果需要更多信息,请告诉我,否则会有帮助。

    1 回复  |  直到 6 年前
        1
  •  1
  •   Michael Kay    6 年前

    我不能告诉您出了什么问题(因为它不是您向我们展示的XML文档…),但我可以建议一些诊断操作。

    1. 你说你在执行“验证”,但不清楚你的意思。这是xslt、xpath、xsd吗?我们需要知道你在执行什么。

    2. 这个代码在过去是否有效?如果是这样,那就是问题与运行它的方式有关的确凿证据:最可能的罪魁祸首是类路径不正确。

    3. 函数的名称 {http://www.xbrl.org/2010/function/formula}has-fallback-value() 是使用一个“抽象”URI而不是直接标识Java类(这将是一个类似的东西)。 {java:net.sf.xbrl.Formula}has-fallback-value() )这意味着只有当萨克森被告知去哪里寻找它时,它才能找到它。您正在运行的程序必须以某种方式向Saxon注册此扩展。找到这个代码(或它的文档),看看它可能是如何失败的。

    4. 有一个saxon配置选项来获取有关加载扩展函数的诊断信息。在XSLT命令行的-TJ上,如果您使用Java API,那么它是配置属性StutuxKE.TraceEXEXALALL函数。这向您展示了Saxon定位匹配的外部函数所采取的步骤,这反过来又向您展示了搜索在失败之前所取得的进展:例如,它是否找到了匹配的类,但找不到匹配的方法。鉴于这不是一个直接标识Java类的URI,我并不乐观,这将揭示很多,但值得一试。

    5. 检查您正在使用的Saxon版本,并查看它是否与您正在运行的应用程序的文档一致。