I'm using pugiXML in Xcode and am trying to get paragraphs that are embedded within the text tags. Language I'm using is C++. I do not think this is a duplicate because I've found answers for Visual Studio but not for Xcode and other questions deal with extraction of single lines not entire paragraphs.
The code I've shown correctly retrieves the title and ID but can't extract the text. Text is in the form of paragraphs flanked by the appropriate text tags. My code is as follows:
//open file
if (!doc.load_file("Sample.xml")){
cout << "Couldn't open file" << endl;
}
else{
xml_node page = doc.child("page");
//Correctly getting title and ID
cout << page.child_value("title") << endl;
cout << page.child_value("id") << endl;
//Problem line: can't get text.
cout << page.child_value("text") << endl;
}