From: Ildar <ild...@gm...> - 2006-09-28 06:15:17
|
hi all, I'm new here and might miss the page that describes what I need. Please, send me the link to the page this case. I'm playing with the following XML. <?xml version="1.0" encoding="utf-8"?> <root> <level1> <level2-1>hello</level2-1> </level1> </root> I need to get the content of /root/level1/level2-1. My code is as follows: wxXml2Document doc; wxString err; doc.Load(wxT("****.xml"), &err); if (doc.IsOk()) { wxXml2Node node = doc.GetRoot(); wxString s = node.Find(wxT("level2-1")).GetName(); wxString s1 = node.Find(wxT("level2-1")).GetContent(); wxString s2 = node.Find(wxT("level2-1")).GetFirstChild().GetContent(); } the results are: s == "level2-1" // the same as expected s1 == "" // I expected to get "hello" s2 == "hello" // ? The way I'm accessing the value is quite weird and doesn't seem to be safe... Is there an easier way? Any links/examples/ideas are welcome. Thank you in advance. -- Ildar |