XML: can't use

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
Boz the virtual being
Posts: 10
Joined: Mon Mar 08, 2004 9:01 pm
Location: Omikron

XML: can't use

Post by Boz the virtual being »

I can't use XML files with the new Irrlicht XML Parser. The one in the example "meshviewer" works but if I change anything and save the xml file the program crashes and doesn't load the xml. I tried using 3 different XML editors, even an old Microsoft XML notepad that saved the file to ASCII format. Is this a bug?
saigumi
Posts: 921
Joined: Fri Aug 22, 2003 11:31 am
Location: St. Louis, MO USA
Contact:

Post by saigumi »

Most likely not a bug. Any XML file is just a plain text file.

What do you mean by change? The element tags? The content text?
Crud, how do I do this again?
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post by niko »

Yep, maybe a but. UTF-16 files work, there seem to be problems with simple ASCII-files.
Boz the virtual being
Posts: 10
Joined: Mon Mar 08, 2004 9:01 pm
Location: Omikron

Post by Boz the virtual being »

I used Dreamweaver (it should save to UTF-16) to edit the xml but it doesn't work. Even when I don't change the xml just save it with another program it doesn't work. What XML editor do you use?
saigumi
Posts: 921
Joined: Fri Aug 22, 2003 11:31 am
Location: St. Louis, MO USA
Contact:

Post by saigumi »

Textpad (shareware, but can have syntax highlighting)
Notepad (free)
Crud, how do I do this again?
Luke923
Posts: 59
Joined: Wed Nov 05, 2003 5:26 am

Post by Luke923 »

I'm having the same problem. I started out w/ ANSI (default) in NotePad, and I end up with multiples of that which resembles the following in my debug:

Code: Select all

Could not load texture: C:\progs\espionage\media\Textures\04_jupiter.bmpýýýýð­ºð­ºð­º««««««««
And, when I try saving it in Unicode (which I assume is UTF-16 LE) and Unicode Big Endian, I end up with the same result.

This is my code

Code: Select all

c8* YUWorld::GetCData(io::IXMLReader* xml,wchar_t* attrib)
{
	wchar_t*		wtmp	= (wchar_t*)xml->getAttributeValue(attrib);
#ifdef _NDEBUG
	io::IXMLWriter*	XML		= IDevice->getFileSystem()->createXMLWriter("c:\\progs\\espionage\\debug.txt");
	XML->writeText(wtmp);
	XML->drop();
#endif
	c8*				ctmp	= (c8*)malloc(wcslen(wtmp));
	wcstombs(ctmp, wtmp, wcslen(wtmp));
	return ctmp;
}
For the most part, it seems good, but I know I'm overlooking something. You can call me Ben Stein, because I asking, "Anyone? Anyone?"
"Object-oriented programming is an exceptionally bad idea which could only have originated in California."
- E.W. Dijkstra
Post Reply