xPath vs DOM Comparison for XML Parsing

This is a little comparison between XPath and DOM. I hope this will help you to determine which method is better suited for your situation.

Complexity: XPath is much simpler that DOM. XPath can also be used in SQL directly while DOM you must write a stored procedure.

Flexibility: DOM is much flexible than XPath. You can read an entire XML document without knowing any specifics about the document upfront. In XPath, knowledge of the document design is required.

Speed: In our test on 11.2.0.3 on Linux, DOM was 3 times as fast as XPath when parsing 500,000 XML documents.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s