Hi
I develop an XTension for Quark XPress 6.5 (Macintosh / Mac OS X 10.3.9)
using Codewarrior 8.3. In this XTension I use Xerces (2.1) to parse a XML
file. QuarkXPress itself has Xerces implemented in Avenue (to handle XML
douments).
I use Xerces in the following way:
-- BEGIN -----
...
XMLPlatformUtils::Initialize();
SAX2XMLReader* pXMLParser = XMLReaderFactory::createXMLReader();
pXMLParser->setFeature(XMLUni::fgSAX2CoreValidation, true);
pXMLParser->setFeature(XMLUni::fgXercesDynamic, true);
pXMLParser->setFeature(XMLUni::fgSAX2CoreNameSpaces, true); //
Processing namespace enabled
pXMLParser->setFeature(XMLUni::fgXercesSchema, true); //
Processing schema enabled
pXMLParser->setFeature(XMLUni::fgXercesSchemaFullChecking, false); // Full
schema constraint checking processing disabled
pXMLParser->setFeature(XMLUni::fgSAX2CoreNameSpacePrefixes, false); //
pXMLParser->Namespace-prefixes feature disabled
// Content- and Errorhandler
int errorCount = 0;
int errorCode = 0;
try {
CGenerateFromXMLHandler oHandler(m_iProcess, m_sXMLFile); // my handler
pXMLParser->setContentHandler(&oHandler);
pXMLParser->setErrorHandler(&oHandler);
#if MACOS
pXMLParser->parse(sXMLFile.c_str());
#else
pXMLParser->parse(m_sXMLFile.c_str());
#endif
errorCount = pXMLParser->getErrorCount();
delete pXMLParser;
}
XMLPlatformUtils::Terminate();
...
-- END -------
This code is called in a loop for different XML files, this means
"XMLPlatformUtils::Initialize();", "SAX2XMLReader* pXMLParser =
XMLReaderFactory::createXMLReader();" and "XMLPlatformUtils::Terminate();"
are called one time for every run in the loop.
During the parsing a QuarkXPress document is opened, boxes and text is set
and so on. Different API functions of the QuarkXPress XDK for the
development of XTensions are used for that.
The problem is that QuarkXPress crashs sooner or later with an "access fault
exception" (memory) if I do that on this way. Sometimes it works, sometimes
not. Sometimes I can parse the XML files, but if I repeat the same test it
crashs. It seems to be a problem with Xerces, but I have no idea what the
problem could be. I have tested my code for memory problems but it seems to
be OK. I also comment out some code pieces in my XTension, but XPress crashs
anyway (on another place of the code). When I comment out the Xerces part in
my XTension it works, no crash. But of course I can do that only for
testing, I need Xerces in my Xtension.
- Is there maybe a problem if I call "XMLPlatformUtils::Initialize();" and
"XMLPlatformUtils::Terminate();" again and agin?
- Is there maybe a problem if QuarkXPress itself call one of this methods (I
don't know if it is so)?
- Maybe a memory problem?
- Is there a generally problem in Mac OS X 10.3.9 with Xerces?
- Maybe a problem in my code?
I have tried the same with Xerces 2.7, but it is the same problem.
Thanks for any help and support.
Best regards
Hans Stössel
--
View this message in context:
http://www.nabble.com/MAC-OS-X-10.3.9---Quark-6.5-XTension---Xerces-2.1%3A-QuarkXPress-crashs-tf2805928.html#a7828432
Sent from the Xerces - C - Users mailing list archive at Nabble.com.