I've improved the structure, added some more basic building blocks, put in some stuff about settings/getting attributes and a basic save-C++-objects-to-XML section.
Lee: I've checked this into CVS already.
Comments welcome
Ellers
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you very much for updating your tutorial. The original was very useful and helped me get started with TinyXML.
The updates make it even more useful - especially the section on XML to/from C++ objects. I wish I had had this when I got started. Almost all XML tutorials seem to address the web page designer rather than the engineer who wants to save data as XML.
A couple of suggestions:
1) Could you add a section 'Decode C++ state from XML'?
2) In AppSettings::save(), is the declaration of 'name' missing?
David
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the nice words David, much appreciated! I hope the new version is just as useful + more.
The 'decode' section is the very thing I wanted to finish today but ran out of time. Rest assured that it is not forgotten.
name: No, although it does look like it - it is a member variable (AKA "field") of the AppSettings class. Usually I like to prefix all member vars with "m_", but my private convention is that if the field is public I don't put that there. I might modify it to be "this->name" because that will be much clearer for the tutorial (though a bit yicky, depending on your code style prefs).
Ellers
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
On TinyBind: Hasn't been touched since the original import...and yet, 90% activitiy and 300 downloads. Clearly a need and interest there. Eries, any interest in a new version?
On XML for web pages: pah! I wrote this thing because I got sick of re-writing config file parsers. You mean XML is actually used for something? ;-)
lee
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
-
2010-08-02
hello All,
just wanted to point out one small error i encountered while using the tutorial.
in
"
void dump_to_stdout( TiXmlNode * pParent, unsigned int indent = 0 )
{switch ( t )
{................
case TiXmlNode::DOCUMENT
]:
.........
case TiXmlNode::ELEMENT:
..........
case TiXmlNode::COMMENT:
............
case TiXmlNode::UNKNOWN:
.............
case TiXmlNode::TEXT:
...........
case TiXmlNode::DECLARATION:
...............
}
"
the enum values are different i.e instead of "DOCUMENT " its "TINYXML_DOCUMENT"
e.g
case TiXmlNode::TINYXML_DOCUMENT
and so on for the rest of the cases.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
All,
The tutorial has been updated and uploaded to:
http://software.ellerton.net/tinyxml.html
I've improved the structure, added some more basic building blocks, put in some stuff about settings/getting attributes and a basic save-C++-objects-to-XML section.
Lee: I've checked this into CVS already.
Comments welcome
Ellers
Hi Ellers
Thank you very much for updating your tutorial. The original was very useful and helped me get started with TinyXML.
The updates make it even more useful - especially the section on XML to/from C++ objects. I wish I had had this when I got started. Almost all XML tutorials seem to address the web page designer rather than the engineer who wants to save data as XML.
A couple of suggestions:
1) Could you add a section 'Decode C++ state from XML'?
2) In AppSettings::save(), is the declaration of 'name' missing?
David
Thanks for the nice words David, much appreciated! I hope the new version is just as useful + more.
The 'decode' section is the very thing I wanted to finish today but ran out of time. Rest assured that it is not forgotten.
name: No, although it does look like it - it is a member variable (AKA "field") of the AppSettings class. Usually I like to prefix all member vars with "m_", but my private convention is that if the field is public I don't put that there. I might modify it to be "this->name" because that will be much clearer for the tutorial (though a bit yicky, depending on your code style prefs).
Ellers
On the tutorial: Thanks Ellers! Nice update.
On TinyBind: Hasn't been touched since the original import...and yet, 90% activitiy and 300 downloads. Clearly a need and interest there. Eries, any interest in a new version?
On XML for web pages: pah! I wrote this thing because I got sick of re-writing config file parsers. You mean XML is actually used for something? ;-)
lee
Hi again
I had more time tonight than I expected so I finished off the XML to/from C++ state section.
All feedback welcome...
http://software.ellerton.net/tinyxml.html
Ellers
hello All,
just wanted to point out one small error i encountered while using the tutorial.
in
"
"
the enum values are different i.e instead of "DOCUMENT " its "TINYXML_DOCUMENT"
e.g
case TiXmlNode::TINYXML_DOCUMENT
and so on for the rest of the cases.