PLSQL XML特殊字符转换
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PLSQL XML特殊字符转换相关的知识,希望对你有一定的参考价值。
---特殊字符转换
function process_xml(old_xml in varchar2) return varchar2 as
new_xml varchar2(1000);
begin
select replace(old_xml, ‘<‘, ‘<‘) into new_xml from dual;
select replace(new_xml, ‘>‘, ‘>‘) into new_xml from dual;
select replace(new_xml, ‘&‘, ‘&‘) into new_xml from dual;
select replace(new_xml, ‘‘‘‘, ‘'‘) into new_xml from dual;
select replace(new_xml, ‘"‘, ‘"‘) into new_xml from dual;
SELECT regexp_replace(new_xml, ‘^(\W)*|(\W)*$‘, ‘‘)
INTO new_xml
FROM dual;
return new_xml;
exception
when others then
return ‘ERROR!‘;
end process_xml;
以上是关于PLSQL XML特殊字符转换的主要内容,如果未能解决你的问题,请参考以下文章