Hi,

I believe the code sample at the following location
http://xml.apache.org/xerces-c/program.html

Under the heading ->

SAX2 Programming Guide
Constructing an XML Reader

Is incorrect.

The section that reads ->

    ContentHandler* contentHandler = new DefaultHandler();
                      ErrorHandler* errHandler = (ErrorHandler*) contentHandler;
                      parser->setContentHandler(contentHandler);
                      parser->setErrorHandler(errHandler);

I believe should read ->

    DefaultHandler* defaultHandler= new DefaultHandler();
                      ContentHandler* contentHandler= (ContentHandler*) defaultHandler;
                      ErrorHandler* errHandler = (ErrorHandler*) defaultHandler;
                      parser->setContentHandler(contentHandler);
                      parser->setErrorHandler(errHandler);

If not the virtual function pointer table contained within errHandler is
incorrect (i.e. is some subset of the contentHandler's virtual methods)
......

Thanks
Will


This communication is for informational purposes only.  It is not intended as
an offer or solicitation for the purchase or sale of any financial instrument
or as an official confirmation of any transaction. All market prices, data
and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein
do not necessarily reflect those of J.P. Morgan Chase & Co., its
subsidiaries and affiliates.


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

Reply via email to