PL/SQL中是否存在将文本转换/编码为XML兼容文本的方法? [英] Is there a method in PL/SQL to convert/encode text to XML compliant text?
问题描述
我有一位同事,他需要通过更新文本模板来构建Excel电子表格,因此需要将PL/SQL方法中的文本转换为XML兼容的文本.
I have a colleague who needs to convert text from a PL/SQL method into XML compliant text, as he is constructing a excel spreadsheet by updating a text template.
PL/SQL中是否存在将文本转换/编码为XML兼容文本的方法?
Is there a method in PL/SQL to convert/encode text to XML compliant text?
推荐答案
好吧,如果您只想转换XML字符,则需要做类似的事情...
Well, if you just want to convert XML characters, you'll want to do something like...
outgoing_text := DBMS_XMLGEN.CONVERT(incoming_text)
outgoing_text
和incoming_text
均为VARCHAR2或CLOB.
Where outgoing_text
and incoming_text
are both VARCHAR2 or CLOB.
您可以指定第二个参数,但默认值为DBMS_XMLGEN.ENTITY_ENCODE
...它还可以通过将DBMS_XMLGEN.ENTITY_DECODE
作为第二个参数传递来解码XML实体.
You can specify a second argument, but it defaults to DBMS_XMLGEN.ENTITY_ENCODE
... it can also decode XML entities by passing DBMS_XMLGEN.ENTITY_DECODE
as a second argument.
这篇关于PL/SQL中是否存在将文本转换/编码为XML兼容文本的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!