Re: [xml] Still validating while using SAX Interface?

Date view Thread view Subject view Author view

From: Daniel Veillard (Daniel.Veillard@w3.org)
Date: Sun Oct 15 2000 - 15:51:13 EDT


On Sun, Oct 15, 2000 at 09:29:54PM +0200, rolf@pointsman.de wrote:
>
>
> 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.

  right

> 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

  no in SAX.c

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

  or rather build the DOM tree and then uses it for validation

> Well, I want to use the SAX Interface while still validating. In

  I don't know how to do this:
    - SAX basically operate on constant memory use
    - the amount of memory needed for validating is not constant
So you have to keep informations ... I use DOM.

> theory, this should not be to difficult. There should be another set

  It is, thing about entities references !

> of default handlers, that does only the validation stuff and then,
> instead of building the libxml DOM tree, call my registered handler
> funktions.

  No the validation need state stored in the DOM

> I've scanned through the code in SAXvalidation.c and it seems, the
  
  SAXvalidation.c does not exist in my tree ... are you sure you're
talking about libxml ???
  The validation basically uses the file valid.c

> 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?

   Wrong,

Daniel

-- 
Daniel.Veillard@w3.org | W3C, INRIA Rhone-Alpes  | Today's Bookmarks :
Tel : +33 476 615 257  | 655, avenue de l'Europe | Linux XML libxml WWW
Fax : +33 476 615 207  | 38330 Montbonnot FRANCE | Gnome rpm2html rpmfind
 http://www.w3.org/People/all#veillard%40w3.org  | RPM badminton Kaffe
----
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 - 16:43:15 EDT