Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

XMLDOM vs SQL - is one method "better" or is it a case of "horses for courses"?

user640107Apr 20 2015 — edited Apr 21 2015

As a PL/SQL developer, when trolling the web, I repeatedly come across people referring to dbms_xmldom usage for XML manipulation as "an old fashioned approach" and recommending that SQL statements be used in preference.

While I understand that in many contexts SQL may be the "better" choice, I simply don't get these blanket "dbms_xmldom is bad; SQL is good" statements as:

  1. DOM is very much not legacy as a concept. As a simple example, every browser I am aware of has DOM at its core, and this shows no signs I can see of changing.
  2. As a general principle,it would seem sensible to minimise switches between the PL/SQL and SQL engines
  3. Relating to 2 above: In my experience, in fairly complex XML document manipulation, replacing the SQL component with dbms_xmldom calls has significantly improved performance of the process.

However, I fully recognise that I may be "missing something" and I would like to make sure that:

  • dbms_xml dom is not a "legacy" technology that Oracle intends phasing out or not evolving (which would surprise me tremendously)
  • There is not some other reason I am unaware of that makes it "bad practise" in the Oracle world to use dbms_xmldom.

I am therefore inviting commentary from all you experts out there to enlighten me (and anyone else who may feel the same way as I do)!

thanks

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 19 2015
Added on Apr 20 2015
2 comments
1,106 views