Re: [xml] DOM: validation



On Wed, Nov 20, 2002 at 10:05:09PM +0100, Murray Cumming wrote:
Does xmlParseFile() do validation as well as well-formedness checks? How
can I turn validation off and on? Or is validation a separate procedure?
What's a good example of this?

  I think at this point you will have to start reading code.
Parsing options can be activated at 2 level:
   - global variables which are used to set default processing options
   - local settings in the parsing context which are initialized with
     those global variables.

  You can get xmlParseFile() to do validation, but you have to turn on
xmlDoValidityCheckingDefaultValue the other option is to use a lower
level interface giving you back a parser context and set up ctxt->validate
before calling xmlParseDocument(). As a library, I'm afraid you will have
to go the hard way like xmlCreateFileParserCtxt().

  I suggest you read the xmllint.c source code as it explore a lot of 
different parsing options, though it often use the global variable.

Daniel

-- 
Daniel Veillard      | Red Hat Network https://rhn.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]