DO NOT REPLY [Bug 34713] New: - Bug in Example source for SAX usage of C++ API

[email protected] Mon, 2 May 2005 18:59:49 +0200 (CEST)
Newsgroups gmane.text.xml.xerces-p.devel
Message-ID <[email protected]>
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34713>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34713

           Summary: Bug in Example source for SAX usage of C++ API
           Product: Xerces-P
           Version: unspecified
          Platform: PC
               URL: http://http://xml.apache.org/xerces-c/program-
                    sax.html#SAXParser
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Documentation
        AssignedTo: [email protected]
        ReportedBy: [email protected]


At http://xml.apache.org/xerces-c/program-sax.html#SAXParser,
you find in the example source for "SAXParser Constructing a SAXParser":

DocumentHandler* docHandler = new HandlerBase();
ErrorHandler* errHandler = (ErrorHandler*) docHandler;

With this usage, for example, my fatal errors were reported as end tags.

Solution: Replace the quoted lines by

CSaxHandler* saxHandler = new CSaxHandler();
DocumentHandler* docHandler = saxHandler;
ErrorHandler* errHandler = saxHandler;

and you will get a correct cast of errHandler (compare statical coherences).

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.