【问题标题】:LPX-00607: Invalid reference: 'ends-with'LPX-00607:无效参考:'ends-with'
【发布时间】:2018-02-27 07:16:21
【问题描述】:

我得到以下错误:

ORA-31011: XML 解析失败 ORA-19202: XML 处理中发生错误 LPX-00607:无效的参考:'ends-with'。 31011. 00000 - “XML 解析失败” *原因:XML 解析器在尝试解析文档时返回错误。 *Action:检查要解析的文档是否有效。 当我尝试在 oracle SQLDeveloper 中执行以下语句时,请有人帮我修复以下查询。

select emp_id, Extract(emp_xml, '//node()[ancestor::item_content 或祖先::stimulus_reference][not(ancestor::rationale)][self::inline_variable]/preceding-sibling::node( )[1][self::text()][not(ends-with(., " ") or ends-with(., " ") or ends-with(., "—"))]')。 getStringVal() 作为信息 来自emp where emp_id ='S348'

谢谢。

【问题讨论】:

    标签: oracle


    【解决方案1】:

    Extract()函数is deprecated,我认为它只支持XPath 1.0规范。 ends-with 是 XPath 2.0 规范的一部分。

    如果您改用XMLQuery(),它会使用包含 XPath 2 的 XQuery。所以我认为这应该可以吗?

    select XMLQuery(
      '//node()[ancestor::item_content or ancestor::stimulus_reference][not(ancestor::rationale)][self::inline_variable]/preceding-sibling::node()[1][self::text()][not(ends-with(., " ") or ends-with(., " ") or ends-with(., "—"))]'
      PASSING emp_xml RETURNING CONTENT).getStringVal() as info
    from emp where emp_id ='S348';
    

    【讨论】:

      猜你喜欢
      • 2020-08-16
      • 1970-01-01
      • 2018-03-21
      • 1970-01-01
      • 2020-04-14
      • 1970-01-01
      • 1970-01-01
      • 2018-01-22
      • 1970-01-01
      相关资源
      最近更新 更多