finding out if result is empty

Help
2004-11-19
2012-10-08
  • Francis Upton
    Francis Upton
    2004-11-19

    I have a situation where I run XQuery and use either StreamResult or SAXResult (as specified by the caller to my application), and I would like an easy way to determine if the transformation produced no output. Obviously, I can put something in front of each of these Result objects to detect this, but I'm wondering if there is an easier way.

    Thanks,

    Francis

     
    • Michael Kay
      Michael Kay
      2004-11-20

      I would recommend using the run() method with a StreamResult or SAXResult only for queries that produce a well-formed XML document as their result. If the result is XML, then of course you can find out anything you need to know about it using another query.

      Apart from that, I'm really not sure what you had in mind.

      Michael Kay