I'm guessing this is Windows with MSVC (next time, mention this in your post).
I'm guessing you didn't mean literally "not" because that won't compile.
And it would be easier if you did
cout << "success="<<success<<endl;
Anyway, chances are you're running your executable from a different directory than where your file is.
Options:
- put the full path of the file in the string (e.g. move to c:\whatever.xml)
- edit the options in studio and tell it exactly where to run from (its probably running from the Debug dir)
- run it from a dos shell so you have full control
HTH
Ellers
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2008-11-24
I am using Dev-C++ with MingW and yes I wrote "not" litterally and works.
The executable is in the same place as the file, and writing the full path doesnt works.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have the following code:
TiXmlDocument document("text.xml");
bool success = document.LoadFile();
if(not success) cout << "no";
and it prints always "no"
Whats the problem, TinyXML cant read my file!!
I'm guessing this is Windows with MSVC (next time, mention this in your post).
I'm guessing you didn't mean literally "not" because that won't compile.
And it would be easier if you did
cout << "success="<<success<<endl;
Anyway, chances are you're running your executable from a different directory than where your file is.
Options:
- put the full path of the file in the string (e.g. move to c:\whatever.xml)
- edit the options in studio and tell it exactly where to run from (its probably running from the Debug dir)
- run it from a dos shell so you have full control
HTH
Ellers
I am using Dev-C++ with MingW and yes I wrote "not" litterally and works.
The executable is in the same place as the file, and writing the full path doesnt works.
Fair enough. I guess "not" is #ifdef'd to "!" in your code base.
Still, just in case "not" isn't defined correctly, why not use the following instead and you'll remove any chance of it being wrong?:
cout << "success="<<success<<endl;
I thought there was an error code or message set somewhere - I don't have the src handy, but have a look and see.
Failing that, step through it in the debugger.
And otherwise, post the contents of the xml file; perhaps it really isn't valid.
Anyway, you can give me some directions to extract de type attribute and the content of "Contenido"?
<?xml version='1.0' encoding='iso-8859-1'?>
<transmision>
<msg type='nombre'><contenido>Jualin</contenido></msg>
</transmision>
Thanks for the help.