.net - CLR C++ syntax question about GetElementsByTagName -


i'm newbie in c++. have xml file , code:

xmldocument^ xml = gcnew xmldocument(); xml -> load( "url.xml" );  box -> text = xml -> documentelement -> getelementsbytagname("item") -> item(0) -> getelementsbytagname("title") -> item(0) -> innerxml; // code doesnt work. 

and xml file:

 <item>       <pubdate>date</pubdate>       <title>title</title>       <author>author</author>       <description>description</description  </item>  <item>  ... 

i want title tag first item. , dont know how. please.

upd. tried code, not work :(

xml -> documentelement -> getelementsbytagname("item") -> item(0) -> childnodes  -> getelementsbytagname("title") -> item(0) -> innerxml; 

if call xml.loadxml() using string copies have file, error </description doesn't have end >. if fix that, xmlexception because have multiple root elements. if remove second <item>, can give me title (converted on fly c# code):

xmlelement^ item = (xmlelement)(xml->getelementsbytagname("item")->item(0)); string^ title = item->getelementsbytagname("title")->item(0)->innerxml; 

Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -