Hello everyone, I just realized I need to learn some XML for my program because that would make it easier so, since I have some time, I wanted to flick through a nice guide/manual on the net before buying a real book (maybe).
Does anyone know a very nice guide on the net for XML? A complete guide with maybe examples and easy-tips and anything that makes a guide "nice"
I've already checked the search feature in this forums but didn't find anything in here and I am already browsing google as we speak, looking for a nice guide, but surely some help from you professional programmers would be awesome
heh yeah I found http://www.w3schools.com/xml/xml_view.asp this page right after I posted that message and read it (most of it) and now I can understand the basics behind XML... so well, I made a test program to see if it worked but I'm having problems because I don't really know how to start reading from an XML file... this is my program (the important part):
I don't know if the reading process is correct or not, I don't think so since it's not working properly, I get an int number like "3086andsomeotherdigits" instead of "3"... I also tried getAttributeValueAsInt but I get the same results... can somebody give me a brief explanation or tell me what's the wrong part in that code? thanks a lot
and it's totally screwed up o.o
I mean, I don't understand how it's possible that it NEVER enters into the second if but inside the first if when I print all the getNodeName() I DO get a "var1" node name, which doesn't get passed into the following if condition... I really don't understand this, can somebody enlighten me very please?
stringc test = read->getNodeName();
if(test.equals_ignore_case("var1"))
or try tinyXML...
Wow it works I guess it was a lower/upper case problem, thanks a lot
anyways what's tinyXML? It might be interesting and, if as you said it's easier, might want to try it out before I build all my program on IrrXML just to get screwed later
i've started coding using msxml 6.0 api and it looks pretty solid so far as it fits with the design spec. but tinyxml could bring more stuff in shorter time. although it seems that it doesn't load from a string, as most that i found load from a file.
i've got demo #1 for msxml coded and tested, what i found out using msxml sdk is the following:
1) xmldoc object can load from file or string, pretty much covering the two important feature of loading from a file and getting xml data from a remote machine, typically a soap call return data.
2) once loaded, i can walk the dom and pick the elements with corresponding attribs. though i still don't like dealing with LPCSTR and BSTR, though. they're nasty.
anyway, i still have many steps to take, including one demo using tinyxml.
I don't think that these approaches are really different in code size or programming complexity. Of course, irrXML is doing a SAX style, while tinyXML seems to have a DOM. But for the presented purpose using SAX is pretty straight.
The main problem with irrXML for me is that it writes 32-bit chars in linux and I still have not found a single editor on Linux which can handle this. Which means that every time I write something with it in Linux I have to switch to windows whenever I need to modify the xml's. And that just sucks.
edit: And yeah, sorry, that doesn't really belong in the thread. Seeing tinyXml and irrXML compared on the level of reading/writing was just getting on my nerves, as this is so far from the biggest problem I have to fight when using irrXML.
edit2: Also tinyXml and irrXML do different jobs anyway. With tinyXml you work with xml-structures in c++. Mainly in memory! Additionally it offers you the functions to load & save those structures (with a single command!). irrXML is a pure xml reader/writer.