ASF Bugzilla – Attachment 19314 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]
Also consider the case that the XPath expression does not yield a NodeList
XPathExtractor.java.patch.txt (text/plain), 1.34 KB, created by
Jens Vo
on 2006-12-28 07:25:17 UTC
(
hide
)
Description:
Also consider the case that the XPath expression does not yield a NodeList
Filename:
MIME Type:
Creator:
Jens Vo
Created:
2006-12-28 07:25:17 UTC
Size:
1.34 KB
patch
obsolete
>37a38 >> import org.apache.xpath.objects.XObject; >186,187c187,190 >< NodeList matches = XPathAPI.selectNodeList(d,query); >< int length = matches.getLength(); >--- >> XObject xObject = XPathAPI.eval(d, query); >> if (xObject.getType() == XObject.CLASS_NODESET) { >> NodeList matches = xObject.nodelist(); >> int length = matches.getLength(); >191,197c194,200 >< if ( match instanceof Element){ >< // elements have empty nodeValue, but we are usually >< // interested in their content >< val = match.getFirstChild().getNodeValue(); >< } else { >< val = match.getNodeValue(); >< } >--- >> if ( match instanceof Element){ >> // elements have empty nodeValue, but we are usually >> // interested in their content >> val = match.getFirstChild().getNodeValue(); >> } else { >> val = match.getNodeValue(); >> } >200c203 >< vars.put(refName,val); >--- >> vars.put(refName,val); >204c207 >< } >--- >> } >205a209,216 >> } >> 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