Hello everybody,
I am submitting a fix I made to the sources so that it can be included in 
the next release (I am a newbie to this mailing list, so I am not sure if 
and how I can make the change myself - please forgive me).

I have an XML document that points to a DTD including several other DTDs. 
In my program, I use a SAXParser to validate it (by calling 
setDoValidation(true)) but I also call setExitOnFirstFatalError(false) to 
get a report of all the errors. It happens that, if an external entity is 
not a valid one (like in <!ENTITY % anotherFile JUSTJUNK SYSTEM 
"path.dtd">), the validator crashes in 
src\validators\DTD\DTDElementDecl.cpp, function 
DTDElementDecl::createChildModel, because getContentSpec() returns NULL 
(probably due to the fact that the validator created an element definition 
because of a reference to it but it was never filled with the definition).
So my fix was to add a test

         if(!specNode)
                 ThrowXML(RuntimeException, XMLExcepts::CM_UnknownCMSpecType);

even if it recycles an existing exception (but at least it doesn't crash).

Thanks,

Alberto


                         ----------------------------
                             |\      _,,,--,,_
                             /,`.-'`'   ._  \-;;,_
                            |,4-  ) )_   .;.(  `'-'
                           '---''(_/._)-'(_\_)
------------------------------------------------------------------
[EMAIL PROTECTED] is:        Alberto Massari

eXcelon Corp.
25 Mall Road
Burlington, MA, 01803
Phone:+1 (781) 674-5329
Fax: +1 (781) 674-5429
http://www.eXcelonCorp.com

B2B. As it was meant to be.
------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to