need example please. writing to XML file
-
- Posts: 121
- Joined: Tue Feb 10, 2004 6:39 am
- Location: the land of chaotic dreams
- Contact:
need example please. writing to XML file
I'm not sure why, but I seem to be having a lot of difficulty getting this to work.
Will someone please post some code I can use to write to an XML file.
I get nothing but errors when I try to copy and paste things from http://irrlicht.sourceforge.net/docu/cl ... riter.html
Will someone please post some code I can use to write to an XML file.
I get nothing but errors when I try to copy and paste things from http://irrlicht.sourceforge.net/docu/cl ... riter.html
The last sane human being in a world gone mad
http://s8.invisionfree.com/Game_Maker_f ... hp?act=idx
http://s8.invisionfree.com/Game_Maker_f ... hp?act=idx
-
- Posts: 121
- Joined: Tue Feb 10, 2004 6:39 am
- Location: the land of chaotic dreams
- Contact:
I found a misprint in the API
http://irrlicht.sourceforge.net/docu/cl ... eader.html
Getting the reader to work isn't a problem, since there is an example in the Meshviewer code, as well as on the API list. I'm still having trouble with the writer though.
I just got this error:
Device should be capitalized otherwise it causes an error.The code for parsing this file would look like this:
io::IXMLReader* xml = device->getFileSystem()->createXMLReader("config.xml");
Getting the reader to work isn't a problem, since there is an example in the Meshviewer code, as well as on the API list. I'm still having trouble with the writer though.
I just got this error:
I put in include IXMLWriter.h in the meshviewer code, thinking perhaps that was the problem. Nope. It doesn't like that either.h:\irrlicht-0.6\include\IXMLWriter.h(19) : see declaration of 'irr::io::IXMLWriter'
The last sane human being in a world gone mad
http://s8.invisionfree.com/Game_Maker_f ... hp?act=idx
http://s8.invisionfree.com/Game_Maker_f ... hp?act=idx
-
- Posts: 121
- Joined: Tue Feb 10, 2004 6:39 am
- Location: the land of chaotic dreams
- Contact:
Someone please tell me what I'm doing wrong. I got everything else working fine I think. No matter what I put in the () it doesn't work.h:\irrlicht-0.6\examples\9.Meshviewer\main.cpp(344) : error C2761: 'void irr::io::IXMLWriter::writeXMLHeader(void)' : member function redeclaration not allowed
Eagerly awaiting a reply. I'm sure someone has got the XML writer to work by now... hopefully.
The last sane human being in a world gone mad
http://s8.invisionfree.com/Game_Maker_f ... hp?act=idx
http://s8.invisionfree.com/Game_Maker_f ... hp?act=idx
Hi,
the xml-reader is used in the Mesh-viewer example. And in the documentation is the same example.
Be sure you save your xml-file as unicode otherwise he can't read the EOF and repeats infinit the last code (thats the mistake i did )
And if your problems still exist youre welcome to post a bit more of your code
greetings
Maxi
the xml-reader is used in the Mesh-viewer example. And in the documentation is the same example.
Be sure you save your xml-file as unicode otherwise he can't read the EOF and repeats infinit the last code (thats the mistake i did )
And if your problems still exist youre welcome to post a bit more of your code
greetings
Maxi
-
- Posts: 121
- Joined: Tue Feb 10, 2004 6:39 am
- Location: the land of chaotic dreams
- Contact:
I have no problems with the READER. I just need to know how to use the WRITER.
I just posted the spelling error for the reader in my post asking about the writer.
Anyway, can you get it to write to a new XML file? If so, please post some code.
I just posted the spelling error for the reader in my post asking about the writer.
Anyway, can you get it to write to a new XML file? If so, please post some code.
The last sane human being in a world gone mad
http://s8.invisionfree.com/Game_Maker_f ... hp?act=idx
http://s8.invisionfree.com/Game_Maker_f ... hp?act=idx
Here's some code:
It creates a (unicode) file with the following content:
Easy?
regards,
jox
Code: Select all
io::IXMLWriter* xml = Device->getFileSystem()->createXMLWriter("file.xml");
xml->writeXMLHeader();
xml->writeLineBreak();
xml->writeComment(L"This is a Comment");
xml->writeLineBreak();
xml->writeElement(L"Element1", false);
xml->writeText(L"Text");
xml->writeClosingTag(L"Element1");
xml->writeLineBreak();
xml->writeElement(L"Element2", true, L"Attr1", L"Val1");
Code: Select all
<?xml version="1.0"?>
<!--This is a Comment-->
<Element1>Text</Element1>
<Element2 Attr1="Val1" />
regards,
jox
One little addition to my code example.
Don't forget to add the following at the end. (Because you're using a 'create' function (see docs for grab()/drop())).:
Don't forget to add the following at the end. (Because you're using a 'create' function (see docs for grab()/drop())).:
Code: Select all
xml->drop();
Last edited by jox on Wed May 19, 2004 12:07 am, edited 1 time in total.
-
- Posts: 121
- Joined: Tue Feb 10, 2004 6:39 am
- Location: the land of chaotic dreams
- Contact:
13 minutes after my last post someone actually replied. Ack! Why didn't I notice that before?
Anyway, thanks. That works.
Anxiety willing, one of these days I'll actually get something finished.
Anyway, thanks. That works.
Anxiety willing, one of these days I'll actually get something finished.
The last sane human being in a world gone mad
http://s8.invisionfree.com/Game_Maker_f ... hp?act=idx
http://s8.invisionfree.com/Game_Maker_f ... hp?act=idx