mirror of
https://github.com/jezhiggins/arabica
synced 2024-12-27 21:58:30 +01:00
XGrep example output non-nodeset results now too
This commit is contained in:
parent
ef984c7245
commit
42bcf3566b
1 changed files with 15 additions and 11 deletions
|
@ -55,10 +55,11 @@ int main(int argc, char* argv[])
|
||||||
// doc.normalize();
|
// doc.normalize();
|
||||||
Arabica::XPath::XPathValuePtr<std::string> result;
|
Arabica::XPath::XPathValuePtr<std::string> result;
|
||||||
result = xpath->evaluate(doc);
|
result = xpath->evaluate(doc);
|
||||||
if(result->asBool())
|
|
||||||
{
|
|
||||||
std::cout << file << std::endl;
|
std::cout << file << std::endl;
|
||||||
if(result->type() == Arabica::XPath::NODE_SET)
|
switch(result->type())
|
||||||
|
{
|
||||||
|
case Arabica::XPath::NODE_SET:
|
||||||
{
|
{
|
||||||
const Arabica::XPath::NodeSet<std::string>& ns = result->asNodeSet();
|
const Arabica::XPath::NodeSet<std::string>& ns = result->asNodeSet();
|
||||||
for(unsigned int i = 0; i < ns.size(); ++i)
|
for(unsigned int i = 0; i < ns.size(); ++i)
|
||||||
|
@ -66,8 +67,11 @@ int main(int argc, char* argv[])
|
||||||
Arabica::DOM::Node<std::string> n = ns[i];
|
Arabica::DOM::Node<std::string> n = ns[i];
|
||||||
std::cout << n << std::endl;
|
std::cout << n << std::endl;
|
||||||
}
|
}
|
||||||
} // if ..
|
}
|
||||||
} // if ...
|
break;
|
||||||
|
default:
|
||||||
|
std::cout << result->asString() << std::endl;
|
||||||
|
} // switch
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue