Can you build and run the SAX2Print and SAX2Count sample applications? If not, there may be a problem with the build process.
Have you tried debugging through SAX2XMLReader::parse() to see where the crash occurs? That would be my first step. -----Original Message----- From: Darren Odom [mailto:[EMAIL PROTECTED] Sent: Friday, October 05, 2007 11:04 AM To: [email protected] Subject: FW: Determining an element's value using SAX Well, I made a little progress but I could still use some guidance. I am still clueless as to how I should get the data between tags using SAX. If anyone can tell me how, that would make my day. I DID figure out how to get that data using SAX2, using the ContentHandlerr::characters function. The only problem is that every time I try to parse a document with a SAX2XMLReader my program crashes with an unhandled exception. Specifically, the error looks like this. First-chance exception in ConSaxTest.exe (KERNEL32.DLL): 0xE06D7363: Microsoft C++ Exception. I am using Microsoft Visual Studio 6.0 as my dev environment. I can't tell exactly where in the Xercesc dll the problem is happening but it is 2 function calls below the SAX2XMLReader::parse function. It is occurring before any of my ContentHandler or ErrorHandler functions get called. I thought it might have been my source or my code but I have tried parsing different documents of different input types, URL, Local File, Memory Buffer, all to no avail. I have also tried running the sample application located here, http://www.ibm.com/developerworks/xml/library/x-xercc/sidefile1.html, substituting the default handler for the handler used in the example and I got the same error. It may be an issue with VC++ 6.0 or my environment. I don't know. But I do know that the original SAXParser::parse function works great and does not generate this exception. Can anyone out there offer me any advice? Darren ________________________________ From: Darren Odom Sent: Wednesday, October 03, 2007 3:56 PM To: ' Subject: Determining an element's value using SAX Please excuse my ignorance. I am pretty inexperienced with XML and Xerces-c. I am working on a project that uses the SAX parser to extract data from XML files. My problem is that I do not know how to retrieve the value of an element. My terminology may be wrong so I will illustrate with an example. <TEXT selectorcode="STBBA" league="BBA" category="STAT"> <STORYNUMBER>9000-NON-EVENT-MESSAGE-X</STORYNUMBER> <SELECTORCODE>STBBA</SELECTORCODE> In the above code, I can determine the element names such as TEXT, STORYNUMBER, etc. I can also determine the values of attributes such as the value "BBA" of the league attribute. I am determining both of these from the startElement function of the DocumentHandler. What I cannot determine is the data contained within the tags. An example of this is STBBA between the SELECTORCODE tags. I am sure there must be a simple way to access this information but after a rather exhaustive search I cannot seem to find it. Could someone please point me in the right direction? Darren Odom
