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
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/wxcode-users