• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

difference between reading and parsing

 
Ranch Hand
Posts: 94
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is the difference between reading and parsing an XML document ?
Ayan
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
when u parse a xml file, it returns a parsed document with nodes (dom) which u can use for ur calculations or manipulate to ur needs.

to traverse throught the file u hav to parse it..
 
Ranch Hand
Posts: 1241
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The ideas behind reading and parsing are slightly different. Reading a file simply has the aim of transferring its contents from file into memory. Parsing attempts to find some kind of meaning to the contents of the file. This is why you can read just about any kind of file, but only parse those with a structure that the parser can understand.... like XML!

An analogy would be that photocopying a page from a book would be "reading" it (the contents is accessed and copied), while a human looking at the page and understanding a message written on it would be parsing (by analysing the contents as structured information).

Quite often parsing will return an object that can be manipulated, like when using a DOM parser. Not always though - SAX parsing may not return an object. While it appears to have just "read" the document and not actually returned anything, its still doing some parsing to recognise when it comes across chunks of information such as elements and attributes.
[ December 14, 2005: Message edited by: Dave Lenton ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic