You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by Sanat Talmaki <sa...@gmail.com> on 2010/01/30 23:06:23 UTC

help in using parse function.

Hi everybody,

I just started using xerces a couple of days ago. I am trying to create a
DOM from an xml file saved on my pc. I used the function:

const char* xmlFile = "C:\Users\Sanat\Desktop\CEM_Res\books.xml";

    try {
        parser->parse(xmlFile);

Re: help in using parse function.

Posted by bpraoena <bp...@gmail.com>.
sanat,

i see below post, i also finding same issue...

i know it has been a while you had that problem, do you remember what was
that visual quirk?

what is the right exception to catch for this error?



Sanat Talmaki wrote:
> 
> Jon...problem solved...it was a visual studio quirk....thanks for the help
> though
> 
> regards,
> 
> sanat.
> 
> On Sat, Jan 30, 2010 at 8:17 PM, Sanat Talmaki
> <sa...@gmail.com>wrote:
> 
>> i tried using cerr but no effect.
>> I tried looking wsprintf but couldn't figure it out. Is there some other
>> approach I might take ?
>>
>> Can you tell me if there is an error because it can't reach the file
>> through the path I have provided:
>>
>>
>> const char* xmlFile = "C:\\Users\\Sanat\\Desktop\\CEM_Res\\Jan
>> 2010\\xerces_test\\books.xml";
>>
>>     try {
>>         parser->parse(xmlFile);
>>         cout << "successfully parsed"<<endl;
>>     }
>>
>> It exits the try block when it tries to parse.
>>
>> -Sanat.
>>
>>
>>
>>
>> On Sat, Jan 30, 2010 at 7:56 PM, John Lilley
>> <jl...@datalever.com>wrote:
>>
>>> You have to output the message yourself to console or appropriate place,
>>> using e.g. wsprintf() if you are console application.
>>> john
>>>
>>>
>>> ________________________________________
>>> From: Sanat Talmaki [sanat.schumi@gmail.com]
>>> Sent: Saturday, January 30, 2010 5:49 PM
>>> To: c-users@xerces.apache.org
>>> Subject: Re: help in using parse function.
>>>
>>> I tried adding that and it gets caught but no message is being
>>> displayed.
>>> The exception is being thrown by the parse function. It is unable to
>>> parse
>>> the xml file.
>>>
>>> Additionally, I am simply trying out the sample that is given on the
>>> xerces
>>> website under the constructing a xercesDOM parser:
>>> http://xerces.apache.org/xerces-c/program-dom-3.html#XercesDOMParser
>>>
>>> All I have done is make the char pointer point to the string with my xml
>>> file path.
>>> I am surprised it is giving me errors due to this.
>>>
>>>
>>>
>>>
>>>
>>> On Sat, Jan 30, 2010 at 7:20 PM, John Lilley <jl...@datalever.com>
>>> wrote:
>>>
>>> > try adding:
>>> >  catch (const SAXParseException& ex) {
>>> >    // output this to see error string:   ex.getMessage();
>>> >  }
>>> >
>>> > Also, if you run in the debugger and go to Debug -> Exceptions and
>>> tell
>>> it
>>> > to trap thrown C++ exceptions, you will see the stack trace where
>>> Xerces
>>> is
>>> > throwing.
>>> >
>>> > john
>>> >
>>> > ________________________________________
>>> > From: Sanat Talmaki [sanat.schumi@gmail.com]
>>> > Sent: Saturday, January 30, 2010 5:03 PM
>>> > To: c-users@xerces.apache.org
>>> > Subject: Re: help in using parse function.
>>> >
>>> > I am unable to figure out why the exception is being thrown:
>>> > 1) I tried setting the path to my xml file correctly:
>>> >   const char* xmlFile = "C:\\Users\\Sanat\\Desktop\\CEM_Res\\Jan
>>> > 2010\\xerces_test\\books.xml";
>>> >
>>> > 2) I set break points and found that the exception is not caught in
>>> >  catch (const XMLException& toCatch)  OR
>>> >  catch (const DOMException& toCatch) BUT caught in:
>>> >
>>> >  catch (...) {
>>> >        cout << "Unexpected Exception \n" ;
>>> >        return -1;
>>> >
>>> > What can i do to figure this out more. I have tried plugging away at
>>> this
>>> > for quite a few hours now :(
>>> >
>>> >
>>> > On Sat, Jan 30, 2010 at 7:00 PM, Sanat Talmaki <sanat.schumi@gmail.com
>>> > >wrote:
>>> >
>>> > > Hi John,
>>> > >
>>> > > I did that, I got this message:
>>> > > First-chance exception at 0x7649f328 in xerces_test.exe: Microsoft
>>> C++
>>> > > exception: xercesc_3_0::SAXParseException at memory location
>>> 0x003eeac8..
>>> > >
>>> > > -sanat.
>>> > >
>>> > >
>>> > > On Sat, Jan 30, 2010 at 6:56 PM, John Lilley <jlilley@datalever.com
>>> > >wrote:
>>> > >
>>> > >>
>>> > >> It sounds like you need to catch a xerces exception.  Xerces throws
>>> > >> exceptions on parse errors.  You also need to initialize Xerces or
>>> it
>>> > will
>>> > >> fail.
>>> > >>
>>> > >> You are using Visual Studio?  Go to Debug -> Exceptions menu and
>>> check
>>> > the
>>> > >> box to catch C++ exceptions when thrown.  That will break at the
>>> error
>>> > >> location in the code.
>>> > >> john
>>> > >>
>>> > >> ________________________________________
>>> > >> From: Sanat Talmaki [sanat.schumi@gmail.com]
>>> > >> Sent: Saturday, January 30, 2010 3:07 PM
>>> > >> To: c-users@xerces.apache.org; c-users-help@xerces.apache.org
>>> > >> Subject: Re: help in using parse function.
>>> > >>
>>> > >> I get the error at runtime:
>>> > >> The thread 'Win32 Thread' (0x1e0c) has exited with code 0 (0x0).
>>> > >> First-chance exception at 0x7649f328 in xerces_test.exe: Microsoft
>>> C++
>>> > >> exception: xercesc_3_0::RuntimeException at memory location
>>> 0x0033f2dc..
>>> > >> First-chance exception at 0x7649f328 in xerces_test.exe: Microsoft
>>> C++
>>> > >> exception: xercesc_3_0::SAXParseException at memory location
>>> > 0x0033db14..
>>> > >> The program '[12040] xerces_test.exe: Native' has exited with code
>>> -1
>>> > >> (0xffffffff).
>>> > >>
>>> > >> If anyone could give me some advice I would be extremely grateful.
>>> > >>
>>> > >> Thanks,
>>> > >>
>>> > >> Sanat.
>>> > >>
>>> > >>
>>> > >>
>>> > >>
>>> > >> On Sat, Jan 30, 2010 at 5:06 PM, Sanat Talmaki <
>>> sanat.schumi@gmail.com
>>> > >> >wrote:
>>> > >>
>>> > >> > Hi everybody,
>>> > >> >
>>> > >> > I just started using xerces a couple of days ago. I am trying to
>>> > create
>>> > >> a
>>> > >> > DOM from an xml file saved on my pc. I used the function:
>>> > >> >
>>> > >> > const char* xmlFile = "C:\Users\Sanat\Desktop\CEM_Res\books.xml";
>>> > >> >
>>> > >> >     try {
>>> > >> >         parser->parse(xmlFile);
>>> > >> >
>>> > >> >
>>> > >>
>>> > >
>>> > >
>>> >
>>>
>>
>>
> 
> 

-- 
View this message in context: http://old.nabble.com/help-in-using-parse-function.-tp27387907p31184250.html
Sent from the Xerces - C - Users mailing list archive at Nabble.com.


Re: help in using parse function.

Posted by Sanat Talmaki <sa...@gmail.com>.
Jon...problem solved...it was a visual studio quirk....thanks for the help
though

regards,

sanat.

On Sat, Jan 30, 2010 at 8:17 PM, Sanat Talmaki <sa...@gmail.com>wrote:

> i tried using cerr but no effect.
> I tried looking wsprintf but couldn't figure it out. Is there some other
> approach I might take ?
>
> Can you tell me if there is an error because it can't reach the file
> through the path I have provided:
>
>
> const char* xmlFile = "C:\\Users\\Sanat\\Desktop\\CEM_Res\\Jan
> 2010\\xerces_test\\books.xml";
>
>     try {
>         parser->parse(xmlFile);
>         cout << "successfully parsed"<<endl;
>     }
>
> It exits the try block when it tries to parse.
>
> -Sanat.
>
>
>
>
> On Sat, Jan 30, 2010 at 7:56 PM, John Lilley <jl...@datalever.com>wrote:
>
>> You have to output the message yourself to console or appropriate place,
>> using e.g. wsprintf() if you are console application.
>> john
>>
>>
>> ________________________________________
>> From: Sanat Talmaki [sanat.schumi@gmail.com]
>> Sent: Saturday, January 30, 2010 5:49 PM
>> To: c-users@xerces.apache.org
>> Subject: Re: help in using parse function.
>>
>> I tried adding that and it gets caught but no message is being displayed.
>> The exception is being thrown by the parse function. It is unable to parse
>> the xml file.
>>
>> Additionally, I am simply trying out the sample that is given on the
>> xerces
>> website under the constructing a xercesDOM parser:
>> http://xerces.apache.org/xerces-c/program-dom-3.html#XercesDOMParser
>>
>> All I have done is make the char pointer point to the string with my xml
>> file path.
>> I am surprised it is giving me errors due to this.
>>
>>
>>
>>
>>
>> On Sat, Jan 30, 2010 at 7:20 PM, John Lilley <jl...@datalever.com>
>> wrote:
>>
>> > try adding:
>> >  catch (const SAXParseException& ex) {
>> >    // output this to see error string:   ex.getMessage();
>> >  }
>> >
>> > Also, if you run in the debugger and go to Debug -> Exceptions and tell
>> it
>> > to trap thrown C++ exceptions, you will see the stack trace where Xerces
>> is
>> > throwing.
>> >
>> > john
>> >
>> > ________________________________________
>> > From: Sanat Talmaki [sanat.schumi@gmail.com]
>> > Sent: Saturday, January 30, 2010 5:03 PM
>> > To: c-users@xerces.apache.org
>> > Subject: Re: help in using parse function.
>> >
>> > I am unable to figure out why the exception is being thrown:
>> > 1) I tried setting the path to my xml file correctly:
>> >   const char* xmlFile = "C:\\Users\\Sanat\\Desktop\\CEM_Res\\Jan
>> > 2010\\xerces_test\\books.xml";
>> >
>> > 2) I set break points and found that the exception is not caught in
>> >  catch (const XMLException& toCatch)  OR
>> >  catch (const DOMException& toCatch) BUT caught in:
>> >
>> >  catch (...) {
>> >        cout << "Unexpected Exception \n" ;
>> >        return -1;
>> >
>> > What can i do to figure this out more. I have tried plugging away at
>> this
>> > for quite a few hours now :(
>> >
>> >
>> > On Sat, Jan 30, 2010 at 7:00 PM, Sanat Talmaki <sanat.schumi@gmail.com
>> > >wrote:
>> >
>> > > Hi John,
>> > >
>> > > I did that, I got this message:
>> > > First-chance exception at 0x7649f328 in xerces_test.exe: Microsoft C++
>> > > exception: xercesc_3_0::SAXParseException at memory location
>> 0x003eeac8..
>> > >
>> > > -sanat.
>> > >
>> > >
>> > > On Sat, Jan 30, 2010 at 6:56 PM, John Lilley <jlilley@datalever.com
>> > >wrote:
>> > >
>> > >>
>> > >> It sounds like you need to catch a xerces exception.  Xerces throws
>> > >> exceptions on parse errors.  You also need to initialize Xerces or it
>> > will
>> > >> fail.
>> > >>
>> > >> You are using Visual Studio?  Go to Debug -> Exceptions menu and
>> check
>> > the
>> > >> box to catch C++ exceptions when thrown.  That will break at the
>> error
>> > >> location in the code.
>> > >> john
>> > >>
>> > >> ________________________________________
>> > >> From: Sanat Talmaki [sanat.schumi@gmail.com]
>> > >> Sent: Saturday, January 30, 2010 3:07 PM
>> > >> To: c-users@xerces.apache.org; c-users-help@xerces.apache.org
>> > >> Subject: Re: help in using parse function.
>> > >>
>> > >> I get the error at runtime:
>> > >> The thread 'Win32 Thread' (0x1e0c) has exited with code 0 (0x0).
>> > >> First-chance exception at 0x7649f328 in xerces_test.exe: Microsoft
>> C++
>> > >> exception: xercesc_3_0::RuntimeException at memory location
>> 0x0033f2dc..
>> > >> First-chance exception at 0x7649f328 in xerces_test.exe: Microsoft
>> C++
>> > >> exception: xercesc_3_0::SAXParseException at memory location
>> > 0x0033db14..
>> > >> The program '[12040] xerces_test.exe: Native' has exited with code -1
>> > >> (0xffffffff).
>> > >>
>> > >> If anyone could give me some advice I would be extremely grateful.
>> > >>
>> > >> Thanks,
>> > >>
>> > >> Sanat.
>> > >>
>> > >>
>> > >>
>> > >>
>> > >> On Sat, Jan 30, 2010 at 5:06 PM, Sanat Talmaki <
>> sanat.schumi@gmail.com
>> > >> >wrote:
>> > >>
>> > >> > Hi everybody,
>> > >> >
>> > >> > I just started using xerces a couple of days ago. I am trying to
>> > create
>> > >> a
>> > >> > DOM from an xml file saved on my pc. I used the function:
>> > >> >
>> > >> > const char* xmlFile = "C:\Users\Sanat\Desktop\CEM_Res\books.xml";
>> > >> >
>> > >> >     try {
>> > >> >         parser->parse(xmlFile);
>> > >> >
>> > >> >
>> > >>
>> > >
>> > >
>> >
>>
>
>

Re: help in using parse function.

Posted by Sanat Talmaki <sa...@gmail.com>.
i tried using cerr but no effect.
I tried looking wsprintf but couldn't figure it out. Is there some other
approach I might take ?

Can you tell me if there is an error because it can't reach the file through
the path I have provided:

const char* xmlFile = "C:\\Users\\Sanat\\Desktop\\CEM_Res\\Jan
2010\\xerces_test\\books.xml";

    try {
        parser->parse(xmlFile);
        cout << "successfully parsed"<<endl;
    }

It exits the try block when it tries to parse.

-Sanat.



On Sat, Jan 30, 2010 at 7:56 PM, John Lilley <jl...@datalever.com> wrote:

> You have to output the message yourself to console or appropriate place,
> using e.g. wsprintf() if you are console application.
> john
>
>
> ________________________________________
> From: Sanat Talmaki [sanat.schumi@gmail.com]
> Sent: Saturday, January 30, 2010 5:49 PM
> To: c-users@xerces.apache.org
> Subject: Re: help in using parse function.
>
> I tried adding that and it gets caught but no message is being displayed.
> The exception is being thrown by the parse function. It is unable to parse
> the xml file.
>
> Additionally, I am simply trying out the sample that is given on the xerces
> website under the constructing a xercesDOM parser:
> http://xerces.apache.org/xerces-c/program-dom-3.html#XercesDOMParser
>
> All I have done is make the char pointer point to the string with my xml
> file path.
> I am surprised it is giving me errors due to this.
>
>
>
>
>
> On Sat, Jan 30, 2010 at 7:20 PM, John Lilley <jl...@datalever.com>
> wrote:
>
> > try adding:
> >  catch (const SAXParseException& ex) {
> >    // output this to see error string:   ex.getMessage();
> >  }
> >
> > Also, if you run in the debugger and go to Debug -> Exceptions and tell
> it
> > to trap thrown C++ exceptions, you will see the stack trace where Xerces
> is
> > throwing.
> >
> > john
> >
> > ________________________________________
> > From: Sanat Talmaki [sanat.schumi@gmail.com]
> > Sent: Saturday, January 30, 2010 5:03 PM
> > To: c-users@xerces.apache.org
> > Subject: Re: help in using parse function.
> >
> > I am unable to figure out why the exception is being thrown:
> > 1) I tried setting the path to my xml file correctly:
> >   const char* xmlFile = "C:\\Users\\Sanat\\Desktop\\CEM_Res\\Jan
> > 2010\\xerces_test\\books.xml";
> >
> > 2) I set break points and found that the exception is not caught in
> >  catch (const XMLException& toCatch)  OR
> >  catch (const DOMException& toCatch) BUT caught in:
> >
> >  catch (...) {
> >        cout << "Unexpected Exception \n" ;
> >        return -1;
> >
> > What can i do to figure this out more. I have tried plugging away at this
> > for quite a few hours now :(
> >
> >
> > On Sat, Jan 30, 2010 at 7:00 PM, Sanat Talmaki <sanat.schumi@gmail.com
> > >wrote:
> >
> > > Hi John,
> > >
> > > I did that, I got this message:
> > > First-chance exception at 0x7649f328 in xerces_test.exe: Microsoft C++
> > > exception: xercesc_3_0::SAXParseException at memory location
> 0x003eeac8..
> > >
> > > -sanat.
> > >
> > >
> > > On Sat, Jan 30, 2010 at 6:56 PM, John Lilley <jlilley@datalever.com
> > >wrote:
> > >
> > >>
> > >> It sounds like you need to catch a xerces exception.  Xerces throws
> > >> exceptions on parse errors.  You also need to initialize Xerces or it
> > will
> > >> fail.
> > >>
> > >> You are using Visual Studio?  Go to Debug -> Exceptions menu and check
> > the
> > >> box to catch C++ exceptions when thrown.  That will break at the error
> > >> location in the code.
> > >> john
> > >>
> > >> ________________________________________
> > >> From: Sanat Talmaki [sanat.schumi@gmail.com]
> > >> Sent: Saturday, January 30, 2010 3:07 PM
> > >> To: c-users@xerces.apache.org; c-users-help@xerces.apache.org
> > >> Subject: Re: help in using parse function.
> > >>
> > >> I get the error at runtime:
> > >> The thread 'Win32 Thread' (0x1e0c) has exited with code 0 (0x0).
> > >> First-chance exception at 0x7649f328 in xerces_test.exe: Microsoft C++
> > >> exception: xercesc_3_0::RuntimeException at memory location
> 0x0033f2dc..
> > >> First-chance exception at 0x7649f328 in xerces_test.exe: Microsoft C++
> > >> exception: xercesc_3_0::SAXParseException at memory location
> > 0x0033db14..
> > >> The program '[12040] xerces_test.exe: Native' has exited with code -1
> > >> (0xffffffff).
> > >>
> > >> If anyone could give me some advice I would be extremely grateful.
> > >>
> > >> Thanks,
> > >>
> > >> Sanat.
> > >>
> > >>
> > >>
> > >>
> > >> On Sat, Jan 30, 2010 at 5:06 PM, Sanat Talmaki <
> sanat.schumi@gmail.com
> > >> >wrote:
> > >>
> > >> > Hi everybody,
> > >> >
> > >> > I just started using xerces a couple of days ago. I am trying to
> > create
> > >> a
> > >> > DOM from an xml file saved on my pc. I used the function:
> > >> >
> > >> > const char* xmlFile = "C:\Users\Sanat\Desktop\CEM_Res\books.xml";
> > >> >
> > >> >     try {
> > >> >         parser->parse(xmlFile);
> > >> >
> > >> >
> > >>
> > >
> > >
> >
>

RE: help in using parse function.

Posted by John Lilley <jl...@datalever.com>.
You have to output the message yourself to console or appropriate place, using e.g. wsprintf() if you are console application.
john


________________________________________
From: Sanat Talmaki [sanat.schumi@gmail.com]
Sent: Saturday, January 30, 2010 5:49 PM
To: c-users@xerces.apache.org
Subject: Re: help in using parse function.

I tried adding that and it gets caught but no message is being displayed.
The exception is being thrown by the parse function. It is unable to parse
the xml file.

Additionally, I am simply trying out the sample that is given on the xerces
website under the constructing a xercesDOM parser:
http://xerces.apache.org/xerces-c/program-dom-3.html#XercesDOMParser

All I have done is make the char pointer point to the string with my xml
file path.
I am surprised it is giving me errors due to this.





On Sat, Jan 30, 2010 at 7:20 PM, John Lilley <jl...@datalever.com> wrote:

> try adding:
>  catch (const SAXParseException& ex) {
>    // output this to see error string:   ex.getMessage();
>  }
>
> Also, if you run in the debugger and go to Debug -> Exceptions and tell it
> to trap thrown C++ exceptions, you will see the stack trace where Xerces is
> throwing.
>
> john
>
> ________________________________________
> From: Sanat Talmaki [sanat.schumi@gmail.com]
> Sent: Saturday, January 30, 2010 5:03 PM
> To: c-users@xerces.apache.org
> Subject: Re: help in using parse function.
>
> I am unable to figure out why the exception is being thrown:
> 1) I tried setting the path to my xml file correctly:
>   const char* xmlFile = "C:\\Users\\Sanat\\Desktop\\CEM_Res\\Jan
> 2010\\xerces_test\\books.xml";
>
> 2) I set break points and found that the exception is not caught in
>  catch (const XMLException& toCatch)  OR
>  catch (const DOMException& toCatch) BUT caught in:
>
>  catch (...) {
>        cout << "Unexpected Exception \n" ;
>        return -1;
>
> What can i do to figure this out more. I have tried plugging away at this
> for quite a few hours now :(
>
>
> On Sat, Jan 30, 2010 at 7:00 PM, Sanat Talmaki <sanat.schumi@gmail.com
> >wrote:
>
> > Hi John,
> >
> > I did that, I got this message:
> > First-chance exception at 0x7649f328 in xerces_test.exe: Microsoft C++
> > exception: xercesc_3_0::SAXParseException at memory location 0x003eeac8..
> >
> > -sanat.
> >
> >
> > On Sat, Jan 30, 2010 at 6:56 PM, John Lilley <jlilley@datalever.com
> >wrote:
> >
> >>
> >> It sounds like you need to catch a xerces exception.  Xerces throws
> >> exceptions on parse errors.  You also need to initialize Xerces or it
> will
> >> fail.
> >>
> >> You are using Visual Studio?  Go to Debug -> Exceptions menu and check
> the
> >> box to catch C++ exceptions when thrown.  That will break at the error
> >> location in the code.
> >> john
> >>
> >> ________________________________________
> >> From: Sanat Talmaki [sanat.schumi@gmail.com]
> >> Sent: Saturday, January 30, 2010 3:07 PM
> >> To: c-users@xerces.apache.org; c-users-help@xerces.apache.org
> >> Subject: Re: help in using parse function.
> >>
> >> I get the error at runtime:
> >> The thread 'Win32 Thread' (0x1e0c) has exited with code 0 (0x0).
> >> First-chance exception at 0x7649f328 in xerces_test.exe: Microsoft C++
> >> exception: xercesc_3_0::RuntimeException at memory location 0x0033f2dc..
> >> First-chance exception at 0x7649f328 in xerces_test.exe: Microsoft C++
> >> exception: xercesc_3_0::SAXParseException at memory location
> 0x0033db14..
> >> The program '[12040] xerces_test.exe: Native' has exited with code -1
> >> (0xffffffff).
> >>
> >> If anyone could give me some advice I would be extremely grateful.
> >>
> >> Thanks,
> >>
> >> Sanat.
> >>
> >>
> >>
> >>
> >> On Sat, Jan 30, 2010 at 5:06 PM, Sanat Talmaki <sanat.schumi@gmail.com
> >> >wrote:
> >>
> >> > Hi everybody,
> >> >
> >> > I just started using xerces a couple of days ago. I am trying to
> create
> >> a
> >> > DOM from an xml file saved on my pc. I used the function:
> >> >
> >> > const char* xmlFile = "C:\Users\Sanat\Desktop\CEM_Res\books.xml";
> >> >
> >> >     try {
> >> >         parser->parse(xmlFile);
> >> >
> >> >
> >>
> >
> >
>

Re: help in using parse function.

Posted by Sanat Talmaki <sa...@gmail.com>.
I tried adding that and it gets caught but no message is being displayed.
The exception is being thrown by the parse function. It is unable to parse
the xml file.

Additionally, I am simply trying out the sample that is given on the xerces
website under the constructing a xercesDOM parser:
http://xerces.apache.org/xerces-c/program-dom-3.html#XercesDOMParser

All I have done is make the char pointer point to the string with my xml
file path.
I am surprised it is giving me errors due to this.





On Sat, Jan 30, 2010 at 7:20 PM, John Lilley <jl...@datalever.com> wrote:

> try adding:
>  catch (const SAXParseException& ex) {
>    // output this to see error string:   ex.getMessage();
>  }
>
> Also, if you run in the debugger and go to Debug -> Exceptions and tell it
> to trap thrown C++ exceptions, you will see the stack trace where Xerces is
> throwing.
>
> john
>
> ________________________________________
> From: Sanat Talmaki [sanat.schumi@gmail.com]
> Sent: Saturday, January 30, 2010 5:03 PM
> To: c-users@xerces.apache.org
> Subject: Re: help in using parse function.
>
> I am unable to figure out why the exception is being thrown:
> 1) I tried setting the path to my xml file correctly:
>   const char* xmlFile = "C:\\Users\\Sanat\\Desktop\\CEM_Res\\Jan
> 2010\\xerces_test\\books.xml";
>
> 2) I set break points and found that the exception is not caught in
>  catch (const XMLException& toCatch)  OR
>  catch (const DOMException& toCatch) BUT caught in:
>
>  catch (...) {
>        cout << "Unexpected Exception \n" ;
>        return -1;
>
> What can i do to figure this out more. I have tried plugging away at this
> for quite a few hours now :(
>
>
> On Sat, Jan 30, 2010 at 7:00 PM, Sanat Talmaki <sanat.schumi@gmail.com
> >wrote:
>
> > Hi John,
> >
> > I did that, I got this message:
> > First-chance exception at 0x7649f328 in xerces_test.exe: Microsoft C++
> > exception: xercesc_3_0::SAXParseException at memory location 0x003eeac8..
> >
> > -sanat.
> >
> >
> > On Sat, Jan 30, 2010 at 6:56 PM, John Lilley <jlilley@datalever.com
> >wrote:
> >
> >>
> >> It sounds like you need to catch a xerces exception.  Xerces throws
> >> exceptions on parse errors.  You also need to initialize Xerces or it
> will
> >> fail.
> >>
> >> You are using Visual Studio?  Go to Debug -> Exceptions menu and check
> the
> >> box to catch C++ exceptions when thrown.  That will break at the error
> >> location in the code.
> >> john
> >>
> >> ________________________________________
> >> From: Sanat Talmaki [sanat.schumi@gmail.com]
> >> Sent: Saturday, January 30, 2010 3:07 PM
> >> To: c-users@xerces.apache.org; c-users-help@xerces.apache.org
> >> Subject: Re: help in using parse function.
> >>
> >> I get the error at runtime:
> >> The thread 'Win32 Thread' (0x1e0c) has exited with code 0 (0x0).
> >> First-chance exception at 0x7649f328 in xerces_test.exe: Microsoft C++
> >> exception: xercesc_3_0::RuntimeException at memory location 0x0033f2dc..
> >> First-chance exception at 0x7649f328 in xerces_test.exe: Microsoft C++
> >> exception: xercesc_3_0::SAXParseException at memory location
> 0x0033db14..
> >> The program '[12040] xerces_test.exe: Native' has exited with code -1
> >> (0xffffffff).
> >>
> >> If anyone could give me some advice I would be extremely grateful.
> >>
> >> Thanks,
> >>
> >> Sanat.
> >>
> >>
> >>
> >>
> >> On Sat, Jan 30, 2010 at 5:06 PM, Sanat Talmaki <sanat.schumi@gmail.com
> >> >wrote:
> >>
> >> > Hi everybody,
> >> >
> >> > I just started using xerces a couple of days ago. I am trying to
> create
> >> a
> >> > DOM from an xml file saved on my pc. I used the function:
> >> >
> >> > const char* xmlFile = "C:\Users\Sanat\Desktop\CEM_Res\books.xml";
> >> >
> >> >     try {
> >> >         parser->parse(xmlFile);
> >> >
> >> >
> >>
> >
> >
>

RE: help in using parse function.

Posted by John Lilley <jl...@datalever.com>.
try adding:
 catch (const SAXParseException& ex) {
    // output this to see error string:   ex.getMessage();
  }

Also, if you run in the debugger and go to Debug -> Exceptions and tell it to trap thrown C++ exceptions, you will see the stack trace where Xerces is throwing.

john

________________________________________
From: Sanat Talmaki [sanat.schumi@gmail.com]
Sent: Saturday, January 30, 2010 5:03 PM
To: c-users@xerces.apache.org
Subject: Re: help in using parse function.

I am unable to figure out why the exception is being thrown:
1) I tried setting the path to my xml file correctly:
   const char* xmlFile = "C:\\Users\\Sanat\\Desktop\\CEM_Res\\Jan
2010\\xerces_test\\books.xml";

2) I set break points and found that the exception is not caught in
  catch (const XMLException& toCatch)  OR
  catch (const DOMException& toCatch) BUT caught in:

  catch (...) {
        cout << "Unexpected Exception \n" ;
        return -1;

What can i do to figure this out more. I have tried plugging away at this
for quite a few hours now :(


On Sat, Jan 30, 2010 at 7:00 PM, Sanat Talmaki <sa...@gmail.com>wrote:

> Hi John,
>
> I did that, I got this message:
> First-chance exception at 0x7649f328 in xerces_test.exe: Microsoft C++
> exception: xercesc_3_0::SAXParseException at memory location 0x003eeac8..
>
> -sanat.
>
>
> On Sat, Jan 30, 2010 at 6:56 PM, John Lilley <jl...@datalever.com>wrote:
>
>>
>> It sounds like you need to catch a xerces exception.  Xerces throws
>> exceptions on parse errors.  You also need to initialize Xerces or it will
>> fail.
>>
>> You are using Visual Studio?  Go to Debug -> Exceptions menu and check the
>> box to catch C++ exceptions when thrown.  That will break at the error
>> location in the code.
>> john
>>
>> ________________________________________
>> From: Sanat Talmaki [sanat.schumi@gmail.com]
>> Sent: Saturday, January 30, 2010 3:07 PM
>> To: c-users@xerces.apache.org; c-users-help@xerces.apache.org
>> Subject: Re: help in using parse function.
>>
>> I get the error at runtime:
>> The thread 'Win32 Thread' (0x1e0c) has exited with code 0 (0x0).
>> First-chance exception at 0x7649f328 in xerces_test.exe: Microsoft C++
>> exception: xercesc_3_0::RuntimeException at memory location 0x0033f2dc..
>> First-chance exception at 0x7649f328 in xerces_test.exe: Microsoft C++
>> exception: xercesc_3_0::SAXParseException at memory location 0x0033db14..
>> The program '[12040] xerces_test.exe: Native' has exited with code -1
>> (0xffffffff).
>>
>> If anyone could give me some advice I would be extremely grateful.
>>
>> Thanks,
>>
>> Sanat.
>>
>>
>>
>>
>> On Sat, Jan 30, 2010 at 5:06 PM, Sanat Talmaki <sanat.schumi@gmail.com
>> >wrote:
>>
>> > Hi everybody,
>> >
>> > I just started using xerces a couple of days ago. I am trying to create
>> a
>> > DOM from an xml file saved on my pc. I used the function:
>> >
>> > const char* xmlFile = "C:\Users\Sanat\Desktop\CEM_Res\books.xml";
>> >
>> >     try {
>> >         parser->parse(xmlFile);
>> >
>> >
>>
>
>

Re: help in using parse function.

Posted by Sanat Talmaki <sa...@gmail.com>.
I am unable to figure out why the exception is being thrown:
1) I tried setting the path to my xml file correctly:
   const char* xmlFile = "C:\\Users\\Sanat\\Desktop\\CEM_Res\\Jan
2010\\xerces_test\\books.xml";

2) I set break points and found that the exception is not caught in
  catch (const XMLException& toCatch)  OR
  catch (const DOMException& toCatch) BUT caught in:

  catch (...) {
        cout << "Unexpected Exception \n" ;
        return -1;

What can i do to figure this out more. I have tried plugging away at this
for quite a few hours now :(


On Sat, Jan 30, 2010 at 7:00 PM, Sanat Talmaki <sa...@gmail.com>wrote:

> Hi John,
>
> I did that, I got this message:
> First-chance exception at 0x7649f328 in xerces_test.exe: Microsoft C++
> exception: xercesc_3_0::SAXParseException at memory location 0x003eeac8..
>
> -sanat.
>
>
> On Sat, Jan 30, 2010 at 6:56 PM, John Lilley <jl...@datalever.com>wrote:
>
>>
>> It sounds like you need to catch a xerces exception.  Xerces throws
>> exceptions on parse errors.  You also need to initialize Xerces or it will
>> fail.
>>
>> You are using Visual Studio?  Go to Debug -> Exceptions menu and check the
>> box to catch C++ exceptions when thrown.  That will break at the error
>> location in the code.
>> john
>>
>> ________________________________________
>> From: Sanat Talmaki [sanat.schumi@gmail.com]
>> Sent: Saturday, January 30, 2010 3:07 PM
>> To: c-users@xerces.apache.org; c-users-help@xerces.apache.org
>> Subject: Re: help in using parse function.
>>
>> I get the error at runtime:
>> The thread 'Win32 Thread' (0x1e0c) has exited with code 0 (0x0).
>> First-chance exception at 0x7649f328 in xerces_test.exe: Microsoft C++
>> exception: xercesc_3_0::RuntimeException at memory location 0x0033f2dc..
>> First-chance exception at 0x7649f328 in xerces_test.exe: Microsoft C++
>> exception: xercesc_3_0::SAXParseException at memory location 0x0033db14..
>> The program '[12040] xerces_test.exe: Native' has exited with code -1
>> (0xffffffff).
>>
>> If anyone could give me some advice I would be extremely grateful.
>>
>> Thanks,
>>
>> Sanat.
>>
>>
>>
>>
>> On Sat, Jan 30, 2010 at 5:06 PM, Sanat Talmaki <sanat.schumi@gmail.com
>> >wrote:
>>
>> > Hi everybody,
>> >
>> > I just started using xerces a couple of days ago. I am trying to create
>> a
>> > DOM from an xml file saved on my pc. I used the function:
>> >
>> > const char* xmlFile = "C:\Users\Sanat\Desktop\CEM_Res\books.xml";
>> >
>> >     try {
>> >         parser->parse(xmlFile);
>> >
>> >
>>
>
>

Re: help in using parse function.

Posted by Sanat Talmaki <sa...@gmail.com>.
Hi John,

I did that, I got this message:
First-chance exception at 0x7649f328 in xerces_test.exe: Microsoft C++
exception: xercesc_3_0::SAXParseException at memory location 0x003eeac8..

-sanat.

On Sat, Jan 30, 2010 at 6:56 PM, John Lilley <jl...@datalever.com> wrote:

>
> It sounds like you need to catch a xerces exception.  Xerces throws
> exceptions on parse errors.  You also need to initialize Xerces or it will
> fail.
>
> You are using Visual Studio?  Go to Debug -> Exceptions menu and check the
> box to catch C++ exceptions when thrown.  That will break at the error
> location in the code.
> john
>
> ________________________________________
> From: Sanat Talmaki [sanat.schumi@gmail.com]
> Sent: Saturday, January 30, 2010 3:07 PM
> To: c-users@xerces.apache.org; c-users-help@xerces.apache.org
> Subject: Re: help in using parse function.
>
> I get the error at runtime:
> The thread 'Win32 Thread' (0x1e0c) has exited with code 0 (0x0).
> First-chance exception at 0x7649f328 in xerces_test.exe: Microsoft C++
> exception: xercesc_3_0::RuntimeException at memory location 0x0033f2dc..
> First-chance exception at 0x7649f328 in xerces_test.exe: Microsoft C++
> exception: xercesc_3_0::SAXParseException at memory location 0x0033db14..
> The program '[12040] xerces_test.exe: Native' has exited with code -1
> (0xffffffff).
>
> If anyone could give me some advice I would be extremely grateful.
>
> Thanks,
>
> Sanat.
>
>
>
>
> On Sat, Jan 30, 2010 at 5:06 PM, Sanat Talmaki <sanat.schumi@gmail.com
> >wrote:
>
> > Hi everybody,
> >
> > I just started using xerces a couple of days ago. I am trying to create a
> > DOM from an xml file saved on my pc. I used the function:
> >
> > const char* xmlFile = "C:\Users\Sanat\Desktop\CEM_Res\books.xml";
> >
> >     try {
> >         parser->parse(xmlFile);
> >
> >
>

RE: help in using parse function.

Posted by John Lilley <jl...@datalever.com>.
It sounds like you need to catch a xerces exception.  Xerces throws exceptions on parse errors.  You also need to initialize Xerces or it will fail.

You are using Visual Studio?  Go to Debug -> Exceptions menu and check the box to catch C++ exceptions when thrown.  That will break at the error location in the code.
john

________________________________________
From: Sanat Talmaki [sanat.schumi@gmail.com]
Sent: Saturday, January 30, 2010 3:07 PM
To: c-users@xerces.apache.org; c-users-help@xerces.apache.org
Subject: Re: help in using parse function.

I get the error at runtime:
The thread 'Win32 Thread' (0x1e0c) has exited with code 0 (0x0).
First-chance exception at 0x7649f328 in xerces_test.exe: Microsoft C++
exception: xercesc_3_0::RuntimeException at memory location 0x0033f2dc..
First-chance exception at 0x7649f328 in xerces_test.exe: Microsoft C++
exception: xercesc_3_0::SAXParseException at memory location 0x0033db14..
The program '[12040] xerces_test.exe: Native' has exited with code -1
(0xffffffff).

If anyone could give me some advice I would be extremely grateful.

Thanks,

Sanat.




On Sat, Jan 30, 2010 at 5:06 PM, Sanat Talmaki <sa...@gmail.com>wrote:

> Hi everybody,
>
> I just started using xerces a couple of days ago. I am trying to create a
> DOM from an xml file saved on my pc. I used the function:
>
> const char* xmlFile = "C:\Users\Sanat\Desktop\CEM_Res\books.xml";
>
>     try {
>         parser->parse(xmlFile);
>
>

Re: help in using parse function.

Posted by Sanat Talmaki <sa...@gmail.com>.
I get the error at runtime:
The thread 'Win32 Thread' (0x1e0c) has exited with code 0 (0x0).
First-chance exception at 0x7649f328 in xerces_test.exe: Microsoft C++
exception: xercesc_3_0::RuntimeException at memory location 0x0033f2dc..
First-chance exception at 0x7649f328 in xerces_test.exe: Microsoft C++
exception: xercesc_3_0::SAXParseException at memory location 0x0033db14..
The program '[12040] xerces_test.exe: Native' has exited with code -1
(0xffffffff).

If anyone could give me some advice I would be extremely grateful.

Thanks,

Sanat.




On Sat, Jan 30, 2010 at 5:06 PM, Sanat Talmaki <sa...@gmail.com>wrote:

> Hi everybody,
>
> I just started using xerces a couple of days ago. I am trying to create a
> DOM from an xml file saved on my pc. I used the function:
>
> const char* xmlFile = "C:\Users\Sanat\Desktop\CEM_Res\books.xml";
>
>     try {
>         parser->parse(xmlFile);
>
>