Recently I had an opportunity to use TinyXML to parse an XML. You can know more about it here:
http://www.grinninglizard.com/tinyxml/
First thing you need to do is download their libraries and compile it. Then only you can start using their code.
Dont forget to include the <#include "tinyxml.h">
//load the document you need to parse
TiXmlDocument document(”Test.xml”);
document.LoadFile();
//
// retrieve the root element
TiXmlElement* root = document.FirstChildElement( “personalInfo” );
//if the root element exists then only proceed to the next element
if ( root )
{
//darshan
TiXmlElement* child = document.FirstChildElement( “name” );
if(child)
{
//do some data manipulation here
//this will retrieve my name “darshan” here
const char* sDesc = root->GetText();
}
}
This way you can go about parsing the XML from one child element to the next
Posted in XML.
Tagged with tinyxml c++ xml.
By admin
– March 3, 2010
check out the post here
http://blog.compete.com/2010/02/17/we%E2%80%99re-number-two-facebook-moves-up-one-big-spot-in-the-charts/
Posted in Uncategorized.
By admin
– February 23, 2010
lets take a look at how to compare two systemtime variables but using Filetime to do so. We make use of the utility method CompareFiletime to do this.
1) store the systemtime in a variable
2) convert it into filetime. Use this method
SystemTimeToFileTime(&systemtime1, &filetime1)
SystemTimeToFileTime(&systemtime2, &filetime2)
3) Compare the filetimes using the method
CompareFileTime(&filetime1, &filetime2) > 0
4) finally convert the filetime to systemtime using the method
FileTimeToSystemTime(..)
Posted in c++, msdn, windows.
By admin
– January 27, 2010
I came across this pretty cool feature on firefox 3.6. It helps to delete a single website you have visited. The difference here is that, in the previous versions, you couldn’t delete a particular website/domain you have visited. This used to be pretty annoying but with this feature you can do it. Here’s how you do it:
1) Goto History
2) Show all history
3) Click on a particular site you have visited
4) Right click and then select forget about this site.
5) This will delete all the history you have stored on that computer, for a single website or domain name only.
Posted in Uncategorized.
Tagged with firefox.
By admin
– January 25, 2010
Posted in Uncategorized.
Tagged with firefox.
By admin
– January 25, 2010
Posted in Uncategorized.
By admin
– January 24, 2010
The easiest way to do this would be to use the option KEY_ENUMERATE_SUB_KEYS when you open the registry key. This option would read both the 32bit and the 64bit registry keys.
Posted in c++, windows.
By admin
– January 15, 2010
This happens usually because in your visual studio vc6 compiler options you would have set the library files path to “Microsoft platform SDKs” , which uses the newer library files. Goto the option again and then set to “Microsoft SDKs” which is set to older SDK. this will help to solve your problem.
Posted in c++, visual studio.
By admin
– January 10, 2010