xerces-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tinny Ng" <tng-...@ca.ibm.com>
Subject Re: XercesDOMParser and
Date Tue, 04 Feb 2003 16:31:16 GMT
Mirko,

Please see if FAQ http://xml.apache.org/xerces-c/faq-build.html#faq-13
helps.

Tinny
----- Original Message -----
From: "Beatrice Mirko" <Mirko.Beatrice@thales-e-transactions.de>
To: <xerces-c-dev@xml.apache.org>
Sent: Tuesday, February 04, 2003 4:12 AM
Subject: XercesDOMParser and


> Hello,
>
> I am using XercesDOMParser to parse xml data stored as string in a
> char-array. After the call
>    MyParser->parse(*memBufIS);
> I get a lot of these messages
>       "First-chance exception in XmlConvTest.exe (KERNEL32.DLL):
0xE06D7363:
> Microsoft C++ Exception."
> in the debug windows of VisualStudio 6.
> The parser works correctly and returns without errors.
> Have I forgot something ?
> Thanks in advance.
> Mirko
>
>
> My code looks like this:
>
>   char Template[]="<?xml version='1.0' encoding='UTF-8'?> ...";
>
>
>
>   const char *XMLdoc = Template;
>   unsigned int DocLen = strlen(Template);
>
>   // Init DOM Parser
>   DOMImplementation *impl =
> DOMImplementationRegistry::getDOMImplementation(NULL);
>   XercesDOMParser *MyParser = new XercesDOMParser;
>   DOMWriter *theSerializer =
> ((DOMImplementationLS*)impl)->createDOMWriter();
>
>   // And install error handler
>   MyErrorHandler = new MyDOMErrorHandler;
>   MyParser->setErrorHandler(MyErrorHandler);
>
>   XercesDOMParser::ValSchemes ValScheme;
>   ValScheme = XercesDOMParser::Val_Auto;
>
>   bool doNamespaces         = true;
>   bool doSchema                = true;
>   bool schemaFullChecking = true;
>
>   MyParser->setDoNamespaces(doNamespaces);
>   MyParser->setDoSchema(doSchema);
>   MyParser->setValidationSchemaFullChecking(schemaFullChecking);
>   MyParser->setValidationScheme(ValScheme);
>
>   MemBufInputSource *memBufIS = new MemBufInputSource( (const XMLByte*)
> XMLdoc, DocLen, (const char*) NULL, false );
>
>   try
>   {
>     MyParser->resetDocumentPool();
>
>     MyParser->parse(*memBufIS);
>
>     MyDocument = MyParser->getDocument();
>
>     MyRootElement = MyDocument->getDocumentElement();
>
>     delete memBufIS;
>   }
> catch ...
>
>
> ---------------------------------------------------------------------
> 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