7 Replies Latest reply on Sep 26, 2006 9:26 AM by ntsiii

    Correct wat to determine if the XPath Query resulted in a match

    Matlus Level 1
      What is the correct way to determine of the XPath Query (using e4x syntax) returned matching nodes?
      The result is never a null reference even if there are no matches found, and I can't seem to find a way to determine if the XMLList returned has any nodes except for a convoluted way like so:

      var matchingRecords:XMLList = xmlData.dataTable[0].dataRow.(@someAttribute == someVariable);
      var record:XML = matchingRecords[0]; //This is the part I don't like to have to do.
      if (record == null)
      //This means no matches were found.
      else
      //This means atleast one match was found.
      }