Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Built-in browser DOM parsers VS. Javascript framework Parsers

Tags:

javascript

xml

I'm diving into javascript and one of the concepts I'm playing with is XML parsing. I see that IE has its own parser, as does Firefox. I also see XML parsers built into some of the javascript frameworks like JQuery. My questions are...

  1. What's the most common or best way to parse XML using javascript these days?
  2. If I use the built-in MS and Firefox parsers, does that mean my code is only guaranteed to work in IE and Firefox, or will the other popular browsers work as well?

Thanks in advance for all your wisdom!

EDIT* I just found this discussion, looks very similar to my question..

like image 374
BeachRunnerFred Avatar asked Oct 17 '25 10:10

BeachRunnerFred


1 Answers

What's the most common or best way to parse XML using javascript these days?

I would use a framework parser to avoid writing code depending on the browser.

If I use the built-in MS and Firefox parsers, does that mean my code is only guaranteed to work in IE and Firefox, or will the other popular browsers work as well?

Each browser has its own way of loading and manipulating XML.

For eg:

IE uses an ActiveX object to load XML whereas firefox doesn't.

like image 187
rahul Avatar answered Oct 19 '25 00:10

rahul