This discussion is archived
8 Replies Latest reply: Jul 24, 2013 8:37 AM by odie_63 RSS

DeleteXml() causing xml data format error in database

alexjingsi Newbie
Currently Being Moderated

Hi, guys,

  I'm using the oracle  xml db 11g in my website application. Last week I found that using the deletexml() to delete a node in the xml may cause a terrible problem that the rest data in the database had wrong xml format. I wonder is it a bug when using binary xml storage.

  My xml data is describe below,

 

<root>

     <nodes>

          <node id="1">

               <name>John</name>

               <age>16</age>

               <hobby>football</hobby>

          </node>

          <node id="2">

               <name>Alex</name>

               <age>22</age>

               <hobby>table tenisl</hobby>

         </node>

          .....

     <nodes>

</root>

 

  I using deletexml() to delete just a node once time,

"update projects set object_value=deletexml(object_value, '/root/nodes/node[@id="1"]')"

Usually it successes and the rest data is as excepted, but sometime, I find that after deleting a node, any query in the database except "select * from projects" gets null. And the rest data has wrong format like below,

<root>

     <nodes>

          <node id="1">

               <name>John</name>

               <age>/hobby>

          </node>

          <node id="2">

               <name>Alex</name>

               <age>22</age>

               <hobby>table tenisl</hobby>

         </node>

          .....

     <nodes>

</root>

Just one format error causes the whole xml data valueless, but it seems that in most time the deletexml() works well, does anyone knows what happens?

Thanks a lot.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points