Bug 41253 - XPathExtractor does not work with non-NodeList XPath expressions
XPathExtractor does not work with non-NodeList XPath expressions
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: Main
2.1.2
All All
: P3 normal (vote)
: ---
Assigned To: JMeter issues mailing list
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2006-12-28 07:13 UTC by Jens Vo
Modified: 2007-02-13 16:36 UTC (History)
0 users



Attachments
Also consider the case that the XPath expression does not yield a NodeList (1.34 KB, patch)
2006-12-28 07:25 UTC, Jens Vo
Details | Diff
(Same as earlier patch, but in (hopefully) correct format) (1.17 KB, patch)
2007-02-13 01:19 UTC, Jens Vo
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jens Vo 2006-12-28 07:13:39 UTC
The XPath expression supplied in the XPathExtractor will not work if it does 
not evaluate to a NodeList. Sometimes however, it is desirable to only select 
one node and apply an XPath function to it, e.g. when attempting to extract a 
portion a text value as in substring-before(//a/@href, ':') (which would 
normally resolve to the protocol of a hyperlink).
Comment 1 Jens Vo 2006-12-28 07:25:17 UTC
Created attachment 19314 [details]
Also consider the case that the XPath expression does not yield a NodeList

The attached file is a patch for the Java source file
src\components\org\apache\jmeter\extractor\XPathExtractor.java.
The documentation might need to be updated accordingly.
Comment 2 Sebb 2007-02-10 04:50:24 UTC
Sorry, but cannot accept the patch, as it is not in unified diff format.

Please can you recreate the patch against the current branch - rel-2-2?
Comment 3 Jens Vo 2007-02-13 01:19:20 UTC
Created attachment 19577 [details]
(Same as earlier patch, but in (hopefully) correct format)
Comment 4 Sebb 2007-02-13 16:36:44 UTC
Thanks, that patch was a lot easier to review.

Code has been committed.