XSU - problems with special characters in XML

From: SM <smanduk_at_profidata.com.pl>
Date: Sat, 16 Mar 2002 12:35:35 +0100
Message-ID: <a6van3$mhq$1_at_news.tpi.pl>



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 &quot; in case of ").

Example:
- table with 1 varchar2 column

  • 1 row in the table with value: 'Just testing "special" characters'
  • procedure test_xml:

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);

BEGIN
  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 &quot;special&quot; characters</TEXT>    </ROW>
</ROWSET>

The same procedure with v_query := 'select text as "_at_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 Sat Mar 16 2002 - 12:35:35 CET

Original text of this message