[xml] Still validating while using SAX Interface?

Date view Thread view Subject view Author view

From: rolf@pointsman.de
Date: Sun Oct 15 2000 - 15:29:54 EDT


Maybe I've overseen something obvious but as far as I see there are
two ways to use libxml:

o Let libxml build a DOM tree in memory. This allows to enable
  validation, if needed.

o Use the SAX Interface (with an own xmlSAXHandlerPtr). Using this API
  there is now way to use the validating facilities build in into the
  libxml.

As pointed out within the documentation, the first way uses internaly
also the SAX Interface and uses a special set of SAX handler
funktions (xmlDefaultSAXHandler). This special SAX handlers are located
in the file SAXvalidation.c

If validation is enabled, this special handler funktions do two things
at once: they validate the document and they build the DOM tree.

Well, I want to use the SAX Interface while still validating. In
theory, this should not be to difficult. There should be another set
of default handlers, that does only the validation stuff and then,
instead of building the libxml DOM tree, call my registered handler
funktions.

I've scanned through the code in SAXvalidation.c and it seems, the
validation stuff doesn't depend on the in memory tree. But I'm really
not familiar with the code, therefor the question to the guru's:

Is it really true, that the validating code doesn't depend on the in
memory DOM tree?

If so, it should not be to hard, to strip out the tree building parts
out of the functions in SAXvalidation.c and instead call ordinary user
defined handlers. Has someone done something similar, that could help
me on my way?

rolf

----
Message from the list xml@rpmfind.net
Archived at : http://xmlsoft.org/messages/
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@rpmfind.net


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Sun Oct 15 2000 - 15:43:22 EDT