DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: query on xmlparsing in oracle

  1. #1
    Join Date
    Sep 2003
    Location
    india
    Posts
    23

    query on xmlparsing in oracle

    Hi ,
    i am getting the following error during parsing
    it fails during getdoctype().i got the solution from asktom website like it should be some problem with xdk installation , i installed 10g and tried the same , still same error , can someone tell the solution for this
    declare
    l_p xmlparser.parser;
    l_root varchar2(32700) := 'CUSTOMERSAVE';
    begin
    for rec1 in (select * from xml_tab where docid = 1)
    loop
    l_p := xmlparser.newparser;

    xmlparser.setvalidationmode(l_p, true);

    xmlparser.parsedtdclob(l_p,rec1.dtd, l_root);

    xmlparser.setdoctype(l_p, xmlparser.getdoctype(l_p));

    if xmlparser.getvalidationmode(l_p) then

    dbms_output.put_line('TRUE');
    else
    dbms_output.put_line('FALSE');
    end if;

    -- now the parse will attempt to validate vs the
    -- dtd
    xmlparser.parseclob(l_p, rec1.xmldoc);

    if xmlparser.getvalidationmode(l_p) then

    dbms_output.put_line('valid');
    else
    dbms_output.put_line('invalid');
    end if;

    end loop;
    end;

    any dtd doc fails , but it works fine in 9.2.0.1.0 version

    what could be the problem.......


    thanks in advance
    ramya

  2. #2
    Join Date
    Mar 2002
    Location
    Mesa, Arizona
    Posts
    1,204
    What's the error?

    Does it kill your session? If so, is there anything in the alert log or any .trc files?

    Seems to me we had simular problems and had to upgrade from 9.2.0.5 to 9.2.0.6

    -Ken

  3. #3
    Join Date
    Sep 2003
    Location
    india
    Posts
    23

    reply

    hi ken,
    This is the error which i get ,

    declare
    *
    ERROR at line 1:
    ORA-06525: Length Mismatch for CHAR or RAW data
    ORA-06512: at "XDB.DBMS_XMLPARSER", line 632
    ORA-06512: at line 16

    not able to find the exact problem...

    Thanks
    ramya

  4. #4
    Join Date
    Jan 2001
    Posts
    2,828
    Hi

    In 9iR2 and above, the XDK for PL/SQL is no longer installed since all but dbms_xmlquery and dbms_xmlsave have been transitioned to C and incorporated into the database as XDB (XML Database).

    This information is included here for consistency. However the script below only installs the XDK for Java -- no pl/sql APIs other than DBMS_SAVE and DBMS_XMLQUERY are installed. ALthough one could manually create wrappers to these java classes and make a PL/SQL API for PL/SQL programmers, this is not
    supported since this functionality is already included in the server via DBMS_ packages written in C/C++ using the XDK for C/C++.

    Logon into SQL*Plus as SYS and run the following script:

    For both Unix and Windows:

    SQL> [ORACLE_HOME]/rdbms/admin/initxml.sql

    Notes for customers with existing PL/SQL apps that used previous XDK for PL/SQL APIs: In 9iR2, all XML functionality previously found in the XDK for PL/SQL are now found in equivalent DBMS_ packages. The 3 newest packages to replace the java based versions are called dbms_xmldom, dbms_xmlparser, and dbms_xslprocessor. Therefore, after following the above step, you will likely "break" any existing
    apps that use the old API names from the XDK for PL/SQL packages. Rather than try some trick to use the old java based APIs, we recommend you use the dbms_* packages. If you have existing code that uses the original java based packages (xmlparser, xmldom, and xslprocessor), you have 2 options (in order of
    preference):

    1) To use the new C based packages with minor code changes, add "dbms_" to all references to xmlparser, xmldom, and xslprocessor in the application code.

    2) To use the new C based packages without any code changes, drop the public synonyms for these three packages and recreate them pointing to the dbms_* packages.

    drop public synonym dbms_xmldom;
    drop public synonym dbms_xmlparser;
    drop public synonym dbms_xslprocessor;

    create public synonym xmldom for xdb.dbms_xmldom;
    create public synonym xmlparser for xdb.dbms_xmlparser;
    create public synonym xslprocessor for xdb.dbms_xslprocessor;

    grant execute on xmldom to public;
    grant execute on xmlparser to public;
    grant execute on xslprocessor to public;

    regards
    Hrishy

Posting Permissions

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


Click Here to Expand Forum to Full Width