Christoph Kies wrote:

Am Dienstag, 17. Januar 2006 18:51 schrieb dara:
Hi Christoph,

I've not used DTDs but it looks to me like the definition for "Name" in
the dtd provided is a comment !

Hi Clara,
i commented <Name> out because i _want_ to get en error.
My question is: Why do i _not_ get an error?

Thank you, for showing me, that i have to point that out.
Hi again Christoph

Ah indeed, apologies, I missed that important point  :)

Re why you are not getting a message, are you wrapping the parse call in a "try" and then "catching" exceptions that may be thrown ?

Ala :

    try
       {
           parser->parse(gXmlFile);
       }
       catch (const OutOfMemoryException&)
       {
           XERCES_STD_QUALIFIER cerr << "OutOfMemoryException" <<
   XERCES_STD_QUALIFIER endl;
           errorsOccured = true;
       }
       catch (const XMLException& e)
       {
           XERCES_STD_QUALIFIER cerr << "An error occurred during
   parsing\n   Message: "
                << StrX(e.getMessage()) << XERCES_STD_QUALIFIER endl;
           errorsOccured = true;
       }

This is from the DOMPrint example in xerces-c-src_2_7_0/samples/DOMPrint/

Running these samples and looking through their source are generally good ways to get started with Xerces.

When I run "bin/DOMPrint -v=always todo.xml" with your sample xml and dtd, I do get a number of errors, so I would suggest to check your code against the sample.

Regards

Dara

Reply via email to