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

How a Parser function?

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

What exactly a parser will do, once it start parsing an �xml� document?
Can any one provide some light on this?

Regards
Johnson :roll:
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It depends on the type of parser.

The two most common models for parsers will either build a model of the XML in memory (aka DOM parsers), which allows it to be navigated in various ways, or will fire events as it parses the tree sequentially (the SAX specification covers these).

This would cover most needs for a parser, but you could potentially write your own parser to do something strange like parse an XML in reverse, firing off events as it does so.
 
Johnson Jose
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bolton,

Thanks for the information.

Regards
Johnson
 
Ranch Hand
Posts: 578
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by DW Bolton:
It depends on the type of parser.

The two most common models for parsers will either build a model of the XML in memory (aka DOM parsers), which allows it to be navigated in various ways, or will fire events as it parses the tree sequentially (the SAX specification covers these).

This would cover most needs for a parser, but you could potentially write your own parser to do something strange like parse an XML in reverse, firing off events as it does so.



And just to add on to that, a xml parser will make sure that the XMl document is well formed(open-close tags, valid characters ..) also and it it is validating parser, will validate teh contents and structure of the XMl present against a DTD or a Schema

And most of the commercial parsers available today are validating parsers

HTH
 
please buy this thing and then I get a fat cut of the action:
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