XMLReader reads only first character - why?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
LarryTM
Posts: 8
Joined: Wed Aug 17, 2005 10:26 am
Location: Warsaw, Poland.
Contact:

XMLReader reads only first character - why?

Post by LarryTM »

Hi!

I have little problem with xmlreader - it reads only the first character from every line :/

Here is my xml file :

Code: Select all

<?xml version="1.0"?> 
<config>
<scr_res_x>1024</res_x>
<scr_res_y>768</res_y>
<scr_fs>0</scr_fs>
</config>
and my reader code :

Code: Select all

while(xml_file && xml_file->read())
          {								
				switch(xml_file->getNodeType()) 
					{						
					case io::EXN_TEXT:	
						{
								temp = xml_file->getNodeData(); 
								printf("%s\n",temp.c_str());
								break;	
						}
					}
			}
    delete xml_file;
and the output is :

Code: Select all

1
7
0
(first line is blank :/ dont know why - maybe because the <config> has no text inside?)

So what is wrong? :/
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post by bitplane »

maybe its your bad xml. try verifying your xml in internet explorer before using it in irrlicht
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
Post Reply