Solved

Error is ORA-31011: XML parsing failed

Posted on 2008-10-05
1
2,036 Views
Last Modified: 2013-11-18
Hello,  Please help me to solve this problem.....
The following PLSQL code works fine in Oracle 9i for transforming xsl document to xml
We have upgrade to 10g and then onwards we get the following error.
****************Error is ORA-31011: XML parsing failed******************

The PLSQL code is
***********************
 FUNCTION transform (
      SOURCE           xmldom.domdocument,
      style            dbms_xslprocessor.stylesheet,
      params           paramlist := NONE,
      debug_on         BOOLEAN := FALSE,
      debug_with_xml   BOOLEAN := TRUE
   )
     
        RETURN CLOB IS
          engine   dbms_xslprocessor.processor := dbms_xslprocessor.newprocessor;
                OUT CLOB;
         xmldoc1 CLOB;
xslelem xmldom.DOMElement;
nspace varchar2(50);
xslcmds xmldom.DOMNodeList;

   BEGIN
      setparams (style, params, debug_on);
        dbms_lob.createtemporary(OUT,false);
      dbms_xmldom.writetoCLOB(SOURCE,xmldoc1);
   xslelem := xmldom.getDocumentElement(source);
   nspace := xmldom.getNamespace(xslelem);
      DBMS_xslprocessor.processxsl (engine, style, SOURCE, OUT);
     dbms_xslprocessor.freeprocessor (engine);
      RETURN OUT;
   EXCEPTION
      WHEN OTHERS THEN
          impact_xml_utility.process_message ('ERROR in xlsprocessor : ');
          dbms_output.put_line('Error is ' ||SQLERRM);
         dbms_xslprocessor.freeprocessor (engine);
         RAISE;
   END;
*******************************demomerge.xsl document********************
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" indent="yes"/>
     <xsl:variable name="doc2" select="document('file:///opt/simpact/Connector/Vendors/demo2.xml')"/>
     <xsl:template match="@*|node()">
         <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
          </xsl:copy>
       <xsl:tempate>

  <xsl:tempalte match="msg">
    <xsl:copy>
       <xsl:apply-templates select="@*|node()"/>
         <text><xsl:value-of select="$doc2/messages/msg[key=current()/key]/text"/>
     </text>
 </xsl:copy>
</xsl:template>
</xsl:stylesheet>
************************************
**********************demo1.xml*******************
<messages>
   <msg>
     <key>AAA</key>
     <num>01001</num>
  <msg>
    <msg>
     <key>bbb</key>
     <num>01011</num>
  <msg>
</messages>
***************************************
******************************demo2.xml*****************
<messages>
   <msg>
     <key>AAA</key>
     <text>This is a Message</text>
  <msg>
    <msg>
     <key>bbb</key>
     <text>This is another Message</text>
  <msg>
</messages>
****************************


0
Comment
Question by:rajsan1
1 Comment
 
LVL 27

Accepted Solution

by:
BigRat earned 500 total points
ID: 22668396
Line 8 of the XSLT is incorrect. It should read </xsl:template> but actually reads <xsl:tempate>.
Line 12 is incorrect. It should read   <xsl:template match="msg"> but reads   <xsl:tempalte match="msg">
Lines 15 and 16 refer to a "text" element without any xsl prefix. I see no need for these elements anyway.

After I make those corrections the XSL compiles correctly.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Adobe Customization Wizard XI issues 26 235
API Soap Calls 4 113
How to redirect all users but me properly to another page with htaccess 2 95
Advice in Xamarin 21 79
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question