Question Details

No question body available.

Tags

c++ pugixml

Answers (1)

July 14, 2025 Score: 2 Rep: 99 Quality: Low Completeness: 40%

Xpath query was incorrect. Need to add a "." to the Xpath query to make it start at the selected node. Second query should be:

auto pathnode = namenode.parent().select_node(".//coordinates");

The value that was being returned was the first occurrence of a coordinates node in the entire document, which just so happened to match.