【问题标题】:clob to xmltype: converting " to &quoteclob 到 xmltype:将“转换为 &”
【发布时间】:2017-08-29 06:47:08
【问题描述】:

我在 plsql 中将 clob 转换为 xmltype,如下所示。 xml xmltype := xmltype(Input);

输入变量包含如下文本

<request xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
   <comment>Hello, this is "james"</comment>
</request>

xmltype转换后文本变为Hello, this is &amp;quot;james&amp;quot;"

当尝试从 xmltype 中提取 xml 时,我需要将文本提取为 Hello, this is "james"

【问题讨论】:

    标签: oracle plsql xmltype


    【解决方案1】:

    Xmlcast

    select xmlcast(xmltype('<request xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
       <comment>Hello, this is "james"</comment>
    </request>').extract('/request/comment/text()') as varchar2(100) ) from dual;
    

    【讨论】:

      【解决方案2】:

      只需像这样指定字符集:XMLTYPE(Input,NLS_CHARSET_ID('AL32UTF8'))

      【讨论】:

        猜你喜欢
        • 2023-03-10
        • 2015-03-01
        • 1970-01-01
        • 2013-04-16
        • 2011-02-11
        • 1970-01-01
        • 2021-11-21
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多