Ildar ha scritto: > Francesco, > > Thank you, I got the idea. > > However, 2 more questions: > > #1 > > wxString s3 = node.Find(wxT("level2-1")).GetFirstChild().GetName(); > > result: > s3 == "text" // as you mentioned > > but > > wxString s4 = node.Find(wxT("level2-1")).Get(wxT("text")); > > result: > s4 == "" wxXml2Node::Get returns a wxXml2Node, not a wxString. I don't know why the compiler accepts the assignment of a wxXml2Node to a wxString... couldn't you trace it with a debugger and see what happens?
> #2 > > is the following possible? > > |- wxXML_ELEMENT_NODE with name "level2-1" and content="" > |- wxXML_TEXT_NODE with name "" and content="hello" > |- wxXML_TEXT_NODE with name "" and content="bye" > > wxXML_ELEMENT_NODE - contains 2 text nodes. sure; it's possible. IIRC there are some rules which makes libxml2 split a text into two text nodes but I don't remember them right now. However consider also the case of this XML fragment: <node> hello <b>XML</b> world! </node> the "node" node has two text nodes interleaved by an element node (with name="b" and with a single text node as child). Francesco ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ wxCode-users mailing list wxCode-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxcode-users