Re: [xml] DTD Validation when using SAX Parser
- From: Daniel Veillard <veillard redhat com>
- To: dmorriso eagle7 org
- Cc: xml gnome org
- Subject: Re: [xml] DTD Validation when using SAX Parser
- Date: Fri, 16 Dec 2005 02:57:50 -0500
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
use?
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
--
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]