It's easier and faster to write out. Only one downside that hardly effects me much is that root elements specified in the path there are always goign to be the first ones if there are other elements with the same name. The target element u can pick a duplicate index.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2007-07-10
I'll take a look, I think I saw a link to it somewhere on one of these pages and it was broken.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2007-07-10
I'm sticking with what I created. XSDXmlFile is even simpler than TinyXPath. For all my apps I need fast quick easy access.
I found it a lil tough to find example C++ code for TinyXPath on their website. From what I see you have to select nodes. With my class its more simple to access any element attribute or text in only one line of code.
I'm not sure if anyone is interested. I could rewrite it a bit so that it can be standalone, it's as simple as stripping my library specific stuff.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The code should be simplistic to understand. I'm using it for project files, configuration files, even for the index and file information for my archiving. I am also considering writing a memory version (XmlMemory) to handle my archive format so I dont have to extract the xml into a text file. Shouldn't be hard to do now with this existing code.
Let me know what u guys think.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You mentioned:
"I am also considering writing a memory version (XmlMemory) to handle my archive format so I dont have to extract the xml into a text file."
I'm not clear what you mean here... you can parse a string in memory already.
?
Ellers
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I wrote a wrapper around TinyXML that's a lot easier to code. Instead of using trees of code to find your elements & attributes its more like:
CXSDXmlFile XmlFile;
XmlFile.Open("file.xml");
string strValue = GetElementAttribute("ROOTELEMENT\\MYELEMENT", 0 /*Index*/);
XmlFile.Close();
It's easier and faster to write out. Only one downside that hardly effects me much is that root elements specified in the path there are always goign to be the first ones if there are other elements with the same name. The target element u can pick a duplicate index.
Good stuff - but in the interest of code re-use, have you considered TinyXPath? It looks like a similar approach.
http://tinyxpath.sourceforge.net/
lee
I'll take a look, I think I saw a link to it somewhere on one of these pages and it was broken.
I'm sticking with what I created. XSDXmlFile is even simpler than TinyXPath. For all my apps I need fast quick easy access.
I found it a lil tough to find example C++ code for TinyXPath on their website. From what I see you have to select nodes. With my class its more simple to access any element attribute or text in only one line of code.
I'm not sure if anyone is interested. I could rewrite it a bit so that it can be standalone, it's as simple as stripping my library specific stuff.
I think that would be great :)
Ellers
http://x3source.com/downloads/XmlFile.zip
The code should be simplistic to understand. I'm using it for project files, configuration files, even for the index and file information for my archiving. I am also considering writing a memory version (XmlMemory) to handle my archive format so I dont have to extract the xml into a text file. Shouldn't be hard to do now with this existing code.
Let me know what u guys think.
You mentioned:
"I am also considering writing a memory version (XmlMemory) to handle my archive format so I dont have to extract the xml into a text file."
I'm not clear what you mean here... you can parse a string in memory already.
?
Ellers
http://x3source.com/downloads/XmlFile.zip
Yes I know, but I was referring to my wrapper not TinyXML in itself. My wrapper handles files not strings.