miscellaneous/motionbuilder_shelf/module/pugixml/docs/samples/xpath_error.cpp
#include "pugixml.hpp"
#include <iostream>
int main()
{
if (!doc.load_file("xgconsole.xml")) return -1;
try
{
doc.select_nodes("//nodes[#true()]");
}
catch (
const pugi::xpath_exception&
e)
{
std::cout << "Select failed: " << e.what() << std::endl;
}
try
{
doc.select_nodes("(123)/next");
}
catch (const pugi::xpath_exception& e)
{
std::cout << "Select failed: " << e.what() << std::endl;
}
try
{
doc.select_nodes("123");
}
catch (const pugi::xpath_exception& e)
{
std::cout << "Select failed: " << e.what() << std::endl;
}
}