Click to See Complete Forum and Search --> : XML DOM problem


Wolvorine
April 24th, 2005, 01:15 PM
i wanted to know if there is anyway by which i could make a BSTR XML string into real IXMLDOMElementPtr .... OR
Actully i am trying to access a specific node let say it is <autos> , now autos has many other child and sub child nodes...so i simply use XPATH to get all the information of AUTOS node.... this information comes inside IXMLDOMNodeListPtr... and one by one i can show its value in a loop...like below..here m_plDomDocument is the document variable of xml.

IXMLDOMNodeListPtr pParent;
string sCriteria = "//autos";

pParent=m_plDomDocument->selectNodes(_bstr_t(sCriteria.c_str()));


for(int i=0; i<pParent->length; i++)
{
cout<<pParent->item[i]->xml;

}


so by this simple way i can display proper xml information that i had got by this select XPATH. But now suppose i want to traverse each and every node of this XML information that came by XPATH query then how can it be possible????? is there any way to do it? If IXMLDOMNodePtr get the same information as came from XPATH then my life will become so easy ...


HELP ..........