首页 > 代码库 > PLSQL XML特殊字符转换
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特殊字符转换
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。