xerces-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alfredo Muñoz <amu...@eversystems.com>
Subject RE: parsing several xmls
Date Tue, 15 May 2001 19:03:36 GMT
call XMLPlatformUtils::Initialize() just one time.
Alfredo

-----Original Message-----
From: niqlas niqlas [mailto:niqlas@topmail.de]
Sent: Martes, 15 de Mayo de 2001 03:58 a.m.
To: xerces-c-dev@xml.apache.org
Subject: parsing several xmls


i try to parse several xml-documents using XERCES-SAX2-API.
parsing the first xml-document works fine, but on parsing the next document
i got an unhandled exception by the statement:

SAX2XMLReader* parser = XMLReaderFactory::createXMLReader();

can anybody tell me why ??
thx niqlas



here is my code excerpt:
( i do this in a loop for every xml-document )


try  {
   XMLPlatformUtils::Initialize();
}
catch (const XMLException& toCatch)
{
    ...
    return NULL;
}

SAX2XMLReader* parser = XMLReaderFactory::createXMLReader();

parser->setFeature(XMLString::transcode("http://xml.org/sax/features/namespa
ces"), false);
parser->setFeature(XMLString::transcode("http://xml.org/sax/features/validat
ion"), true);
parser->setFeature(XMLString::transcode("http://apache.org/xml/features/vali
dation/dynamic"), true);

XOBHandler handler;
parser->setContentHandler(&handler);
parser->setErrorHandler(&handler);
try  {
    parser->parse( XMLFILE );
}
catch (const XMLException& e)
{
    ....
    XMLPlatformUtils::Terminate();
    return NULL;
}
catch (...)
{
    XMLPlatformUtils::Terminate();
    return NULL;
}

XMLPlatformUtils::Terminate();

___________________________________________________________
TopMail - Jetzt kostenlos anmelden - http://www.topmail.de
* Wollt Ihr Super-Markenartikel zu Schnaeppchen-Preisen? *
****       Dann seid Ihr hier genau richtig!           ***
****     Einfach anklicken und Powershoppen!!!         ***
http://www.powershopping.de/redir.jsp?app=powers&DD=1&DP=81


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org


Mime
View raw message