You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Vagelis Blathras <vb...@mail.ariadne-t.gr> on 2000/05/14 12:56:39 UTC

Problem Encountered with InputSource

I am using Xerces-C v 1.1.0 under Windows 98 and MSVC6 , and I am having
the following problem :

When I use simply a
 SAXParser *parser=new SAXParser;

and then just start parsing with :
        parser->parse(XMLResultFile);

where XMLResultFile is just char * , everything is OK, and multiple
calls to my library for the same file work ok.

But when I decided to use LocalFileInputSource, in order to provide
default encodings for the document, that I like, I use the following :

static XMLCh* tmpstr=XMLString::transcode( (const char*
const)XMLResultFile);
LocalFileInputSource *InputSrcDef;
InputSrcDef = new LocalFileInputSource((const XMLCh* const ) tmpstr);

// Set default encoding to ISO-8859-1
tmpstr=XMLString::transcode( (const char* const)"ISO-8859-1");
InputSrcDef->setEncoding((const XMLCh* const) tmpstr);

and then I use a parser->parse(*InputSrcDef);

the process is ok the first time I call it with a file, for example
"Test.xml"

The second time, it returns me an error that makes me think that it
cannot open the file again.
(At the end of my calling method, everything is cleaned up ok, i think,
by deleting everything possible)

Is there any workaround with this, or is there anything else I could do
in order to give default encodings in XML files that do not provide any?

Thank you for your response....
Vagelis Blathras
vbla@mail.ariadne-t.gr
vbla@itel.gr





Re: Problem Encountered with InputSource

Posted by Dean Roddey <dr...@charmedquark.com>.
I'm not sure exactly what is going on, but I have to question why you are
doign all of the casts in the code you posted? There should be no reason to
be doing all those casts of hte character strings. If you do have to do
them, then that's a sign that something is definitely wrong.

--------------------------
Dean Roddey
The CIDLib Class Libraries
Charmed Quark Software
droddey@charmedquark.com
http://www.charmedquark.com

"Give me immortality, or give me death"

----- Original Message -----
From: "Vagelis Blathras" <vb...@mail.ariadne-t.gr>
To: <xe...@xml.apache.org>
Sent: Sunday, May 14, 2000 3:56 AM
Subject: Problem Encountered with InputSource