Menu

newby question - element text

Anonymous
2004-01-28
2004-01-28
  • Anonymous

    Anonymous - 2004-01-28

    Hello,

    My apologies for the newbyness of this q, but being a newby, I aren't capable of much else :).

    Anyway, if I get an XML element like this:

    TiXmlElement* Title = fHandle.FirstChild("title");

    How do I get the text in that element?

    Eg, in the XML doc it has:

    <title> some text </title>

    I know its gotta be straightforward, but I can't see which (if any) TiXmlElement methods will return this text.

    TIA,

    Vesty.

     
    • B Sizer

      B Sizer - 2004-01-28

      I suggest you read the "How TinyXml works" section of the main documentation page. That shows you that what you're looking for is not a TiXMLElement method as such, but is a TiXmlText node. Call Type() on a node to determine if it's a TiXmlText node or not. Then you call Value() on such a text node to get the string.

       

Log in to post a comment.

MongoDB Logo MongoDB