Re: [xml] About schema validation in libxml 2.6.23



On Mon, Apr 10, 2006 at 10:43:40AM +0530, Ajay Kasam infineon com wrote:
I too have the same question. and to my understanding libxml 2.6.23
provides tree(i.e DOM) based schema validation.
could someone clarify with example or detailed explanation??

  Yes there is SAX based validation support. If you run xmllint with
the options "--sax --schemas schemas_file instance(s)" then it will do
just that, that's part of the regression tests.
  You can just look at how it is done in xmllint.c , see testSAX()
around the code calling xmlSchemaValidateStream().
  In general I try to not promote SAX parsing because it is complex,
and hard to debug, and the last thing I need is beginners trapped into
SAX callback debugging asking for help on this list, so I don't put out
standalone SAX examples, if you use SAX you will have to be able to
find your way around, this is not for beginners.
  There is also support for Schemas at the Reader API which is a quite
simpler streaming API, but yes SAX support is there too.

Daniel

-- 
Daniel Veillard      | Red Hat http://redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]