Read XML from a string in C++ / Unix -


i'm looking simple way read xml contained in string variable in c++ unix systems. have found lot of solutions xml files not lot xml contained in string variable.

do have use functions such find(), etc. or there library missed job me ?


edit:

if have following xml in string, how can read ? (with pugixml example)

string xml = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>";      xml += "<people><person><name>toto</name><age>20</age></person>";      xml += "<person><name>john</name><age>42</age></person></people>"; 

i recommend use tinyxml2 library. xmldocument::parse - best catch (http://grinninglizard.com/tinyxml2docs/classtinyxml2_1_1_x_m_l_document.html#a1819bd34f540a7304c105a6232d25a1f)

and after loading string in xmldocument - can navigate via tinyxml2 tools further.

exact example in documentation -> http://www.grinninglizard.com/tinyxml2docs/_example-3.html


Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

qt - How to embed QML toolbar and menubar into QMainWindow -