Win a copy of Transfer Learning for Natural Language Processing (MEAP) this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

interview question

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All
These are a few interview questions on xml. I am a newbie to xml. I searched the site for the answers , got some brief answers but no detailed
explanation.
1) WHich is faster DOM or SAX. Kindly give an ellaborate answer. In practical applications which is more appropriate to use
2) What are namespaces used for. This is what i know in order to avoid name clashing between xml tags we can use namespaces .
Any other ??
3) Suppose if we want to manipulate some xml element values , Which 1 to for & why (dom or sax)
Rgrds
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) WHich is faster DOM or SAX. Kindly give an ellaborate answer. In practical applications which is more appropriate to use
There is no one answer for this question, IMO.
Its as easy as asking "Is Java better or C better to write a program?"
2) What are namespaces used for. This is what i know in order to avoid name clashing between xml tags we can use namespaces .
Any other ??

That is correct. Namesapces are defined to differentiate between
same element-names used in different contexts.
3) Suppose if we want to manipulate some xml element values , Which 1 to for & why (dom or sax)
Same as above...its not easy.
Apples vs Oranges comparision.
Orange is orange in color, apple is not.
Oranges have more Vitamin C than apples.
anyways....you get the picture!
My two cents...
- madhav
 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
interview Q's
The person asked all the relevant Q's.
1) DOM is tree based memory intensive parser. and it can be updated
2) SAX is a event driven parser used for very large files. This doesnt allow any changes or update to the file( xml). This is read only.
DOM used SAX to handle its parsing. The best parser known in the market is dom4j which has a cleaner code for document handling.
DOM is only used for a very small data. SAX is used for a huge xml data file.
Steve
 
Seriously? That's what you're going with? I prefer this tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic