Re: [xml] external DTD validation of large XML's



XMLStarlet does this too, maybe it will be useful for you:
http://xmlstar.git.sourceforge.net/git/gitweb.cgi?p=xmlstar/xmlstar;a=blob;f=src/xml_validate.c;hb=HEAD

Thank you for this link and taking the time to give helpful answers to jumpstart my libxml2 knowledge.

I'll check how you validate via libxml2 in XMLStarlet as my eventual goal is to statically link an xml 
processor and lua into a single scriptable host exe for easy deployment/use by my developers.  Sort of like 
http://fossil-scm.org/ single file executables.

Question...after skimming your configure.ac should

  
http://xmlstar.git.sourceforge.net/git/gitweb.cgi?p=xmlstar/xmlstar;a=blob;f=configure.ac;h=21d647fc71f443578e35e188b9cb7135e031ce1d;hb=HEAD#l80

link against ws2_32 instead of wsock32?


2) Does the following mean that when using libxml2's SAX functionality a document representation of the 
entire input XML is created in memory?

   http://git.gnome.org/browse/libxml2/tree/xmllint.c#n1711

No, it depends on the handler in use. The code you reference there is
checking for unexpected creation of DOM tree: unexpected because neither
the emptySAXHandler nor the debugSAXHandler create a DOM tree.

Ah, I see. As none of xmllint's SAX callbacks are creating memory structures, memory usage is likely 
determined by the parser and it's context's needs.


3) As of v2.7.8 and using the Reader API, there is no way to validate using an external DTD similar to

   http://git.gnome.org/browse/libxml2/tree/xmllint.c#n1881
   http://git.gnome.org/browse/libxml2/tree/xmllint.c#n1896


Yes, see https://bugzilla.gnome.org/show_bug.cgi?id=169375

2005?...probably not enough demand/interest to make this happen. The world's moved to XSDs and only we poor 
schmos with clients refusing to move from legacy DTDs care about this anymore ;)

And I hate the idea autoconverting their "golden" DTDs into XSDs and likely having to cleanup after the 
conversion tool. Or spending time persuading folks that the converted XSD is still just as "golden" as the 
original.


Jon

---
blog: http://jonforums.github.com/
twitter: @jonforums

"Anyone who can only think of one way to spell a word obviously lacks imagination." - Mark Twain



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