Re: [xml] DTD Validation when using SAX Parser

On Thu, Dec 15, 2005 at 07:44:55PM -0700, Dan Morrison wrote:
I am using the SAX parser in libxml to read in relatively large XML
files.  I am using SAX for two reasons:
  - I store all data in non-XML related internal data structures, and
  - I find the callback interface intuitive.

I have a requirement to validate the input XML files against a DTD
prior to parsing them into my internal data structures with SAX.  Do I
need to read the DTD and XML into a DOM tree, validate it, free the
memory, and then proceed with the SAX parsing?  Or is there simpler -
and perhaps less memory and performance intensive - method that I can

  There is no DTD validation at the SAX parsing level, however it
is available for the reader API which is also streaming.
  Adding DTD support for SAX shouldn't be that hard, but it's
available for Schemas and people building new solutions don't tend to
use DTDs and Schemas, so I'm not sure what'ss the real demand for this.


Daniel Veillard      | Red Hat
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

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