【问题标题】:Marklogic - How to handle processing instruction in XMLMarklogic - 如何处理 XML 中的处理指令
【发布时间】:2017-06-14 13:58:50
【问题描述】:

我需要使用 X Query 从 XML 中获取属性值。但是这个属性就像处理指令。那么如何处理这种部分呢?

     Sample XML:
        <root id="12">
        <?test date="3/1966"?>
        <?Names name="Anto. 17"?>
        <title>AUDIT</title>
        </root>

Expected output:
    date = "3/1966"

【问题讨论】:

    标签: xpath xquery marklogic


    【解决方案1】:

    如果它看起来像一个处理指令,那么它就是。

    为特定的处理指令指定目标。

    data(//processing-instruction(test))
    

    所有处理指令

    data(//processing-instruction())
    

    【讨论】:

      猜你喜欢
      • 2016-04-12
      • 2023-03-03
      • 2022-11-29
      • 1970-01-01
      • 2012-01-17
      • 2016-02-16
      • 2023-03-16
      • 1970-01-01
      • 2012-03-16
      相关资源
      最近更新 更多