Skip to content
Snippets Groups Projects
Commit e300701d authored by arseny.kapoulkine@gmail.com's avatar arseny.kapoulkine@gmail.com
Browse files

docs: XPath select_single_node sample checks return value for clarity

git-svn-id: http://pugixml.googlecode.com/svn/trunk@949 99668b35-9821-0410-8761-19e4c4f06640
parent 4c57df7c
No related branches found
No related tags found
No related merge requests found
......@@ -10,17 +10,18 @@ int main()
//[code_xpath_select
pugi::xpath_node_set tools = doc.select_nodes("/Profile/Tools/Tool[@AllowRemote='true' and @DeriveCaptionFrom='lastparam']");
std::cout << "Tools:";
std::cout << "Tools:\n";
for (pugi::xpath_node_set::const_iterator it = tools.begin(); it != tools.end(); ++it)
{
pugi::xpath_node node = *it;
std::cout << " " << node.node().attribute("Filename").value();
std::cout << node.node().attribute("Filename").value() << "\n";
}
pugi::xpath_node build_tool = doc.select_single_node("//Tool[contains(Description, 'build system')]");
std::cout << "\nBuild tool: " << build_tool.node().attribute("Filename").value() << "\n";
if (build_tool)
std::cout << "Build tool: " << build_tool.node().attribute("Filename").value() << "\n";
//]
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment