Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> XSU - problems with special characters in XML

XSU - problems with special characters in XML

From: SM <smanduk_at_profidata.com.pl>
Date: Mon, 18 Mar 2002 10:45:20 +0100
Message-ID: <a74d0f$7et$1@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

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 "@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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US