How does SAX-Validation work?

  • Thread starter Matthias Langbein
  • Start date
M

Matthias Langbein

Hi,

I wondered whether anybody knows how XML-Schema-Validation with the
common SAX-Parsers work. Do they require to build a DOM-Tree before
processing and validate, or do they handle validation on the fly?

Thx, Langi
 
J

Joseph Kesselman

Matthias said:
I wondered whether anybody knows how XML-Schema-Validation with the
common SAX-Parsers work. Do they require to build a DOM-Tree before
processing and validate, or do they handle validation on the fly?

I would assume SAX parsers validate on the fly, essentially by running a
finite state machine based on the schema. Note that this means you may
get halfway through processing the document before you find out that it
doesn't validate; depending on what you're doing with the document that
may mean you need to think about database-style "commit phases" or
reversable operations. (Of course that issue arises any time you've got
data coming in which may be interrupted partway through, including
normal communications traffic.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,001
Messages
2,570,255
Members
46,853
Latest member
GeorgiaSta

Latest Threads

Top