Results 1 to 1 of 1
  1. #1
    Join Date
    Aug 2004
    Posts
    14

    Unanswered: XML generation using XSU (encoding UTF-8)

    Hi there,
    I am using XSU oracle tool to generate xml files. How can I generate xml with UTF-8 encoding?!

    The sql script I am using is the following:

    -----------------------------------------------------------------------
    set serveroutput on size 1000000
    set feedback off
    set heading off
    set pagesize 0
    set linesize 512
    set verify off
    set echo off
    SET PAUSE OFF
    spool F:\RSS\test.xml

    Declare
    queryCtx DBMS_XMLquery.ctxType;
    result CLOB;
    begin
    -- set up the query context...!
    queryCtx := DBMS_XMLQuery.newContext('select * from emp' );

    DBMS_XMLQuery.setXSLT (queryCtx, 'F:\encoding.xsl');

    --change tag names
    DBMS_XMLQuery.setRowTag(queryCtx,'ITEM'); -- sets the row tag name
    DBMS_XMLQuery.setRowSetTag(queryCtx,'CHANNEL'); -- sets rowset tag name
    --sets maximum number of rows to be converted to XML
    DBMS_XMLQuery.setMaxRows(queryCtx,10);

    DBMS_XMLQuery.setTagCase(queryCtx,1); --0 for as are, 1 for lower case, 2 for upper case
    DBMS_XMLQuery.setRowIdAttrName(queryCtx,NULL); --no row id attribute is shown

    -- get the result..
    result := DBMS_XMLQuery.getXML(queryCtx);
    -- Now you can use the result to put it in tables/send as messages..
    printClobOut(result);
    DBMS_XMLQuery.closeContext(queryCtx); -- you must close the query handle..
    end;
    /
    SET SERVEROUTPUT OFF
    SET ECHO OFF
    spool off

    -----------------------------------------------------------------------
    The errors I am getting are:

    ORA-29532: Java call terminated by uncaught Java exception: oracle.xml.sql.OracleXMLSQLException: File 'F:\encoding.xsl' does not exit.
    ORA-06512: at "SYS.DBMS_XMLQUERY", line 80
    ORA-06512: at "SYS.DBMS_XMLQUERY", line 89
    ORA-06512: at line 14

    Thanks,
    Kostas.
    Last edited by kostas88; 11-04-04 at 04:02.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •