This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Check For Empty Nodeset

Hi all,

I'm running a query in a policy and need to check if anything was found. At the moment I check:

XPath(count($resultNodeset) > 0

Is there a better way? Does a DirXML nodeset have something like JS .length that I can check?

Parents
  • Verified Answer

    +1  

    Hi,

    A nodeset does not have something like len() or .length, then again count() > 0 also works just fine.

    You can also check if the result of an xpath expression is empty.

    There are probably more ways to do this.

Reply
  • Verified Answer

    +1  

    Hi,

    A nodeset does not have something like len() or .length, then again count() > 0 also works just fine.

    You can also check if the result of an xpath expression is empty.

    There are probably more ways to do this.

Children
No Data