• 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:

what's XML parser?

 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a simple question. what can be called XML parser? any application that implements SAX and DOM? We need validate the input XML sometimes. Does the Validator is a parser too?
thank you for clarification.
 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would venture to say that an XML parser is an application that validates the document and gives the user an API to access the document. The API can be DOM, SAX or anything else.
Cheers,
Dan
 
lydia westland
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
XSLT processor can also access XML, transform XML, etc. Can we say it's a parser? XML validator validate XML according to schemas, they are XML parser too?
Thank you in advance
 
lydia westland
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since most of XSLT processors are using DOM, I think we can say XSLT processors belong to a kind of parser. I believe so is XSLT validator. is that true?
 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
An XML parser is anything that reads in XML, and provides your application with the nodes and attributes (OK, and PI's etc.) W3C has recommendations for validating and non-validating parsers and what they should return to the application.
A validating parser, validates XML against a schema or DTD. Which means, it checks that the elements and attributes follow certain rules that are expressed in the schema or DTD.
The interesting question here, is what happens to entities (those things defined with & or %) in a validating vs. non-validating parser. But you can read the W3C recommendation if you are interested.
XSLT uses a parser internally, but does not require a schema or DTD. Therefore XSLT processors do not rely on validating parsers. On the other hand if either the XML or XSL document refers to an external entity, you had better hope that the XSLT processor dereferences it properly (something that a validating parser is required to do, but non-validating parsers may do but are not required to do, confusing isn't it?)
Most validating parsers can have their validations turned off programatically.
Does this help?
 
lydia westland
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you. it's clear to me now.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic