Closed GoogleCodeExporter closed 9 years ago
if (node)
or
if (!node)
works.
See
http://pugixml.googlecode.com/svn/tags/latest/docs/manual/xpath.html#xpath_node:
:unspecified_bool_type
Original comment by arseny.k...@gmail.com
on 3 Mar 2013 at 3:00
Clarification from the point of view of API design: empty handles are used
throughout pugixml to designate 'not found' or erroneous state. Since the only
case when select_single_node can return an empty xpath_node is when the query
does not result in any nodes, I don't see any ambiguity here.
Original comment by arseny.k...@gmail.com
on 3 Mar 2013 at 3:07
Arseny, thanks for your comment.
When you say "if (node)" the "node" is the return value from the call? i.e. an
xpath_node?
It would be good to include this in the docs explicitly.. perhaps you could
consider this issue a docs defect?
Original comment by rivimeyc...@gmail.com
on 3 Mar 2013 at 10:08
Yes, it's an xpath_node object. I'll clarify the way to check the return value
in documentation.
Original comment by arseny.k...@gmail.com
on 6 Mar 2013 at 4:04
Documentation has been slightly updated in trunk with this issue in mind;
expect a new documentation in the new version, which should be released soon.
Original comment by arseny.k...@gmail.com
on 10 Jul 2013 at 4:48
Original issue reported on code.google.com by
rivimeyc...@gmail.com
on 3 Mar 2013 at 1:52