• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

XML parser

 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is XML parser similar to compiler?
Thanks
 
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, not really. It just parses the XML file like a browser parses an HTML file and displays it to the user. Of course, I'm not sure if the Java XML parsers are validating (are they), but if they are then they sort of act like a compiler in that they point out structural errors.
 
Ranch Hand
Posts: 395
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Its not a compiler. Infact even the Validating parsers compare the DTD or Schema of a XML and with the source tree.
I think its more like just checking the XML structure using a Grammer for XML. It doesn't conver the XML tree in to any other file format or so.
It returns the parts of the XML depending upon the conditions given by the program which uses the Parser API like DOM or SAX.
So Parser is just a program which navigates through the XML source tree and returns the result as defined in the API.
Thanks.

------------------
L Goundalkar
[email protected]
Sun Certified Programmer for Java 2 Platform
 
Lee Xu
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As i remember, the compiler consists of Parser, Lexical Analyser, Linker. So XML parser is just as the first part of compiler, which parse the syntax of the data. Am I right?
 
Stanley Tan
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What compiler are you talking about? The parser checks the syntax and the structure of the XML document.
 
L Goundalkar
Ranch Hand
Posts: 395
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Lee & Stanlee
I agree with Satnlee..
As for as my knowledge goes, Compiler is something which converts the given program to Machine code form.
Pasrser never does it.
So please don't compare the both.
Thanks.
------------------
L Goundalkar
[email protected]
Sun Certified Programmer for Java 2 Platform
 
Stanley Tan
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, let me try to explain a parser. Someone please help me out if I go astray. Think of a parser like your internet browser. The browser accepts an HTML document and based on certain tags will do certain things to display information to the user or viewer of the document. The browser does not transform the HTML in any way. It merely accepts the document and transforms it into a human readable format (hopefully)
Cheers and good luck learning!
 
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
According to the XML specification (http://www.w3.org/TR/1998/REC-xml-19980210#sec-intro): "A software module called an XML processor is used to read XML documents and provide access to their content and structure. It is assumed that an XML processor is doing its work on behalf of another module, called the application."
This XML processor is more commonly called parser. Basically an XML parser parses (creates internally without output, just remains in RAM) an XML file into a result-tree so that it can be used by others. For instance, with this result-tree, you can apply XSL to output HTML, another XML, voiceXML etc.
 
Stanley Tan
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have to ask... what is voiceXML?
 
Kevin Yip
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Re: VoiceXML
As the name suggests, VoiceXML is an XML-baesd language designed to enable the development of voice-activated applications. Just like XML, the business logic of voice processing is separate from the data.
You can find more info in http://www.voicexml.org.
 
Stanley Tan
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since I'm a newbie, this is the first time I've heard of this. It sounds really interesting!!
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Regarding the XML parser... lets say ur XML file is like a database..then ur parser will be a program to access this database, change it and yes even check or validate it.
This is not the exact way to define it but just a mapping to explain the synonimity.
As far as VoiceXml is concerned it is a xml standard for voice interactive programming. visit the IBM developerworks site for more details.
------------------
abhijit from pune.
Ability alone is not enough for success,it must be sparked by ambition and sustained with determination
 
Stanley Tan
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is all way too much to handle. I think I'll move voiceXML down the learning road for now. I want to get a good grip on XML basics first
 
Ranch Hand
Posts: 2379
MySQL Database Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would like to compare parsers with interpreters rahther than compilers....
------------------
Muhammad Ashikuzzaman (Fahim)
Sun Certified Programmer For Java 2 Platform
--When you learn something, learn it by heart!
 
You guys haven't done this much, have ya? I suggest you study this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic