【问题标题】:enveloping XML-Signature referencing the signatures parent node by XPath通过 XPath 封装引用签名父节点的 XML 签名
【发布时间】:2015-02-02 06:17:41
【问题描述】:

我无法为封装的 XML 签名找出正确的 XPath 表达式。 给出的例子:

<xxx>
 <bbb>
  <Signature>
       <SignedInfo>
         ...
         <Reference>
           <Transforms>
             <Transform>
               <XPath>???<XPath>
             <Transform>
           <Transforms>
           ...
         <Reference>
       <SignedInfo>
       ...
     <Signature>
 </bbb>
 <bbb>
 </bbb>
</xxx>

每个 BBB 可以有自己的签名(XXX 不能),并且 BBB 中不允许有 ID-Attribute。 BBB 可以发生多次。所以我需要告诉签名与它的包络节点一起工作。 可悲的是架构已修复,我知道不是很好,但我必须处理它。

也许 here() 函数 ([http://www.w3.org/TR/xmldsig-filter2/#function-here) 可能会有所帮助?我的建议是:

here()/../../../../../.. 

它从 XPath 节点开始(在链接中注明),然后我沿着签名节点走到我的 BBB 节点,但这看起来很混乱。

【问题讨论】:

    标签: xml xpath xml-signature


    【解决方案1】:

    我得到了答案:

    根本不可能通过 XPath 表达式引用封装的父元素。

    您需要使用参考 ID。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-07-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多