Advertisement

01.06.2006 at 04:38AM PST, ID: 21686430
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.6

Oracle XML DB - extract function fails to parse the XML but after commiting the records, everything works fine.

Asked by jnajayjain in Oracle Database

Tags: , ,

Hi All,

Below is one of the queries we run where we face the problem.

SELECT replace(replace(XMLTYPE.Extract(XMLType(xml_file),'/ContentDetails/ContentComponent/Component[@name="Summary"]/Value/text()').getStringVal(),'<![CDATA[',''),']]>','')
FROM <tableName>
WHERE <condition>

When we run above query usign java class, the error we get in our logs is as follows:

2005-12-30 14:16:53,104 [Thread-17] ERROR com.ge.cms.content.ContentUtils - java.sql.SQLException: ORA-31011: XML parsing failed

ORA-19202: Error occurred in XML processing
LPX-00200: could not convert from encoding UTF-8 to UCS2
Error at line 237
ORA-06512: at "SYS.XMLTYPE", line 0
ORA-06512: at line 1

java.sql.SQLException: ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00200: could not convert from encoding UTF-8 to UCS2
Error at line 237
ORA-06512: at "SYS.XMLTYPE", line 0
ORA-06512: at line 1

The query uses the extract function and retrieve the value of summary node from XML stored in XML_FILE column of table. The XML content in the column are UTF-8 encoded and works fine when they are displayed using Java parsing methods.  Below is the complete XML pasted for your reference.

Strangely, when we touch (deleting the summary, saving it, committing it, changing the summary back to original, saving it and committing it again) this XML in TOAD, it works just fine. Next time onwords it does not create any problem unless we create a new record from the frontend.  

Please suggest. Will appreciate and be greateful for any of the conmments on above problem.

----------------------------
<ContentDetails>
<ContentType Type="STORY">
</ContentType>

 <ContentInfo>
</ContentInfo>

     <ContentComponent type="Header">

<Component name="ContentID">
<Value><![CDATA[81925]]></Value>     </Component>

<Component name="headline">
      <Value><![CDATA[Most Admired]]></Value>
     </Component>

<Component name="Date">
      <Value><![CDATA[01/03/2006]]></Value>
     </Component>

<Component name="Source">
      <Value><![CDATA[11642]]></Value>
     </Component>

<Component name="Category">
      <Value><![CDATA[11709]]></Value>
     </Component>

<Component name="Section-Page">
      <Value><![CDATA[sdfsdfs]]></Value>
     </Component>

<Component name="Author">
      <Value><![CDATA[dfsdfsdfsd]]></Value>
     </Component>

<Component name="URL">
      <Value><![CDATA[]]></Value>
     </Component>

<Component name="HeadlineRefType">
     </Component>




     </ContentComponent>
     <ContentComponent type="Story">


<Component name="Summary">
     <Value><![CDATA[ was named one of the ten most admired companies in Brazil at a ceremony hosted by Mr. Luiz Inácio Lula da Silva, President of Brazil. ááá]]></Value>
     </Component>

<Component name="Body">
     <Value><![CDATA[ement was made this week in a ceremony held in São Paulo. Alexandre Silva, president for ceived the Award from Mr. Luiz Inácio Lula da Silva, President of Brazil, and Mr. Mino Carta, Director of Carta Capital magazine. <BR>&nbsp;<BR>This was the 8th edition of the award which&nbsp; takes place every year to recognize companies with outstanding performance towards ethics, social responsibility and solid financial capabilities.&nbsp; <BR>&nbsp;<BR>GE was one of only three multinational companies amongnst&nbsp; the winners&nbsp; jointly with Microsoft and Nestlé. Other companies recognized with the Award are Natura, Vale do Rio Doce, Gerdau, Tam, Votorantim, Embraer, Petrobrás and Itaú.&nbsp;&nbsp; <BR>&nbsp;<BR>"We are very proud with this award. It is a valuable recognition for all the efforts  has put together while developing its activities in Brazil", said Alexandre Silva .<BR>&nbsp;<BR>Besides president Luiz Inácio Lula da Silva, other important guests were present, including Ministers, opinion leaders , top executives and businessmen.<BR>]]></Value>
     </Component>



     </ContentComponent>
     <ContentComponent type="Poll">



<Component name="Question">
      <Value><![CDATA[]]></Value>
     </Component>

<Component name="Button">
     </Component>

<Component name="Answer">
      <Value><![CDATA[]]></Value>
     </Component>

<Component name="Answer">
      <Value><![CDATA[]]></Value>
     </Component>

<Component name="Answer">
      <Value><![CDATA[]]></Value>
     </Component>

<Component name="Answer">
      <Value><![CDATA[]]></Value>
     </Component>

<Component name="Answer">
      <Value><![CDATA[]]></Value>
     </Component>


     </ContentComponent>
     <ContentComponent type="RelatedLinks">




<Component name="Link">
<URL>http://</URL>
<Title><![CDATA[]]></Title>
     </Component>

<Component name="Link">
<URL>http://</URL>
<Title><![CDATA[]]></Title>
     </Component>

<Component name="Link">
<URL>http://</URL>
<Title><![CDATA[]]></Title>
     </Component>

<Component name="Link">
<URL>http://</URL>
<Title><![CDATA[]]></Title>
     </Component>

<Component name="Link">
<URL>http://</URL>
<Title><![CDATA[]]></Title>
     </Component>

<Component name="Link">
<URL>http://</URL>
<Title><![CDATA[]]></Title>
     </Component>

     </ContentComponent>
<ContentComponent type="Image">
</ContentComponent>
<ContentComponent type="Reference">
</ContentComponent>

</ContentDetails>
--------------------------------

thanks,
jnajayjain.


Start Free Trial
 
 
[+][-]01.06.2006 at 04:54AM PST, ID: 15628099

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.06.2006 at 05:37AM PST, ID: 15628340

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.06.2006 at 05:50AM PST, ID: 15628445

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.06.2006 at 06:33AM PST, ID: 15628843

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]01.07.2006 at 08:52PM PST, ID: 15640441

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 14-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.10.2006 at 06:52AM PST, ID: 15660861

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 14-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.16.2006 at 11:40PM PST, ID: 16213547

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 14-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]03.20.2006 at 11:21AM PST, ID: 16239436

View this solution now by starting your 14-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Oracle Database
Tags: oracle, xml, extract
Sign Up Now!
Solution Provided By: CetusMOD
Participating Experts: 3
Solution Grade: A
 
 
 
Loading Advertisement...
20081112-EE-VQP-43