select_nodes
#569
-
First, this is a VERY nice library. I appreciate all the work you have done. Second,
Thanks. jim |
Beta Was this translation helpful? Give feedback.
Answered by
zeux
Jun 11, 2023
Replies: 2 comments
-
This works for me as expected: #include "pugixml.hpp"
#include <stdio.h>
int main(int argc, char **argv)
{
pugi::xml_document doc;
doc.load_string("<CATALOG><CD>1</CD><CD>2</CD></CATALOG>");
pugi::xml_node catalog = doc.select_node("/CATALOG").node();
for (pugi::xpath_node cd : catalog.select_nodes("CD"))
{
printf("CD text %s\n", cd.node().text().get());
}
return 0;
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
jtaylorme
-
Sorry to have bothered you. I see where I went wrong. After an hour or two of trying different things I decided to ask but turns out it was a incorrect vector reference. Thanks. Jim |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This works for me as expected: