ASF Bugzilla – Attachment 19577 Details for
Bug 41253
XPathExtractor does not work with non-NodeList XPath expressions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
(Same as earlier patch, but in (hopefully) correct format)
XPathExtractor.java.patch.txt (text/plain), 1.17 KB, created by
Jens Vo
on 2007-02-13 01:19:20 UTC
(
hide
)
Description:
(Same as earlier patch, but in (hopefully) correct format)
Filename:
MIME Type:
Creator:
Jens Vo
Created:
2007-02-13 01:19:20 UTC
Size:
1.17 KB
patch
obsolete
>--- XPathExtractor.java.original Tue Feb 13 10:07:06 2007 >+++ XPathExtractor.java Tue Feb 13 10:02:39 2007 >@@ -36,6 +36,7 @@ > import org.apache.jorphan.util.JMeterError; > import org.apache.log.Logger; > import org.apache.xpath.XPathAPI; >+import org.apache.xpath.objects.XObject; > import org.w3c.dom.Document; > import org.w3c.dom.Element; > import org.w3c.dom.Node; >@@ -184,7 +185,9 @@ > throws TransformerException > { > String val = null; >- NodeList matches = XPathAPI.selectNodeList(d,query); >+ XObject xObject = XPathAPI.eval(d, query); >+ if (xObject.getType() == XObject.CLASS_NODESET) { >+ NodeList matches = xObject.nodelist(); > int length = matches.getLength(); > vars.put(concat(refName,MATCH_NR), String.valueOf(length)); > for (int i = 0 ; i < length; i++) { >@@ -205,5 +208,13 @@ > } > vars.remove(concat(refName,String.valueOf(length+1))); > } >- >+ else { >+ val = xObject.toString(); >+ vars.put(concat(refName, MATCH_NR), "1"); >+ vars.put(refName, val); >+ vars.put(concat(refName, "1"), val); >+ vars.remove(concat(refName, "2")); >+ } >+ } >+ > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 41253
:
19314
| 19577