Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> XSU - problems with special characters in XML
Hi,
I'm using XSU to generate XML documents in both canonical and attribute
form.
In attribute form XSU doesn't translate special characters (like " or >)
into
entities (like " in case of ").
Example:
- table with 1 varchar2 column
create or replace procedure test_xml (o_xml OUT clob) is
v_kontekst DBMS_XMLQUERY.CTXTYPE; v_errno NUMBER; v_errmsg VARCHAR2(1000); v_query VARCHAR2(200);
v_query := 'select text from test'; v_kontekst := DBMS_XMLQUERY.NEWCONTEXT(v_query); o_xml := DBMS_XMLQuery.GetXML(v_kontekst);DBMS_XMLQuery.CloseContext(v_kontekst); end test_xml;
returns following correct XML:
<?xml version = '1.0'?>
<ROWSET>
<ROW num="1">
<TEXT>Just testing "special" characters</TEXT>
</ROW>
</ROWSET>
The same procedure with v_query := 'select text as "@textatr" from test';
returns incorrect document:
<?xml version = '1.0'?>
<ROWSET>
<ROW num="1" textattr="Just testing "special" characters"/> </ROWSET>
Any ideas?
Thanx
Szymon Manduk
Oracle 8.1.7 EE with XDK packages
HP-UX11
P.S. How check the version of XDK installed in the database? Received on Mon Mar 18 2002 - 03:45:20 CST