There is a Parse( const char* ) method just for this.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2004-07-15
I was also trying to figure out how to parse an encrypted XML file, if it's decrypted in memory, i have seen this Parse( const char* ) function but there's no explanation nor anything for it.
I don't know what is this for. any example of how to use it would help..
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This code shows how to use Parse() with a plain, unencrypted, normal char array.
It is taken out of tinyxml_2_2_1*.tar.gz tinyxml\xmltest.cpp, just below where main() starts (anything beginning with "//" is my editing):
const char* demoStart =
"<?xml version=\"1.0\" standalone='no' >\n"
"<!-- Our to do list data -->"
"<ToDo>\n"
"<!-- Do I need a secure PDA? -->\n"
"<Item priority=\"1\" distance='close'> Go to the <bold>Toy store!</bold></Item>"
"<Item priority=\"2\" distance='none'> Do bills </Item>"
"<Item priority=\"2\" distance='far & back'> Look for Evil Dinosaurs! </Item>"
"</ToDo>";
if ( doc.Error() )
{
// document failed to load - handle in whatever way is best for your app
printf( "Error in %s: %s\n", doc.Value(), doc.ErrorDesc() );
exit( 1 );
}
// document loaded ok now
I recently wrote some code to read a gzip'd xml file (.svgz) into memory, uncompress it in memory, then pass the raw pointer to TinyXml. Works wonderfully.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2004-07-25
OK that's nice now, i understand but i wish if tiny had some interactive tuts explaining every thing Frequently asked here in forums :(
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I have XML data in memory. Can I create an TiXMLDOcument() of it and work with it?
Basically, my XML data is in memory and not in file, so I just want to use it?
Karam
There is a Parse( const char* ) method just for this.
I was also trying to figure out how to parse an encrypted XML file, if it's decrypted in memory, i have seen this Parse( const char* ) function but there's no explanation nor anything for it.
I don't know what is this for. any example of how to use it would help..
This code shows how to use Parse() with a plain, unencrypted, normal char array.
It is taken out of tinyxml_2_2_1*.tar.gz tinyxml\xmltest.cpp, just below where main() starts (anything beginning with "//" is my editing):
const char* demoStart =
"<?xml version=\"1.0\" standalone='no' >\n"
"<!-- Our to do list data -->"
"<ToDo>\n"
"<!-- Do I need a secure PDA? -->\n"
"<Item priority=\"1\" distance='close'> Go to the <bold>Toy store!</bold></Item>"
"<Item priority=\"2\" distance='none'> Do bills </Item>"
"<Item priority=\"2\" distance='far & back'> Look for Evil Dinosaurs! </Item>"
"</ToDo>";
//... irrelevant stuff edited out for clarity
TiXmlDocument doc( "demotest.xml" );
doc.Parse( demoStart );
if ( doc.Error() )
{
// document failed to load - handle in whatever way is best for your app
printf( "Error in %s: %s\n", doc.Value(), doc.ErrorDesc() );
exit( 1 );
}
// document loaded ok now
I recently wrote some code to read a gzip'd xml file (.svgz) into memory, uncompress it in memory, then pass the raw pointer to TinyXml. Works wonderfully.
OK that's nice now, i understand but i wish if tiny had some interactive tuts explaining every thing Frequently asked here in forums :(