How to get the name of the first child (first tag name) using tinyXML2

soveurl

New Member
I'm using tinyXML2 and I want to get the name of the first child (first tag name) of any/specific parent.I wrote this code but not working:\[code\]#include <iostream>#include "tinyxml2.h"#include <typeinfo>using namespace std;/* run this program using the console pauser or add your own getch, system("pause") or input loop */int main(int argc, char *argv[]) { tinyxml2::XMLDocument doc; doc.LoadFile( "dream.xml" ); //Load XML from a file cout<<doc.FirstChild();return 0;}\[/code\]here my xml file:\[code\]<?xml version="1.0"?><!DOCTYPE PLAY SYSTEM "play.dtd"><PLAY><TITLE>A Midsummer Night's Dream<hiankit>Hi Ankit</hiankit></TITLE></PLAY>\[/code\]Pls help me out..
 
Back
Top