Hi,
I'm trying to run this XPath query on this data:
List list = document.selectNodes( "//[EMAIL PROTECTED]'aw1']" );
int listSize = list.size();
I'm getting 0 as the size for listSize even though I have xhtml (nested
of course) like this:
<a shape="rect" id="aw1"
href="/url?sa=l&ai=Bp8ack1vzQ936Oo68qAKyzfztAveuvhHBhYPsAZ2GwgXwslIQARgBKAc4AEifOVDz99Hz_f____8ByAEBlQIUb0oK&num=1&q=http://www.comp1.com"
onmouseover="return ss('go to
www.comp1.com','aw1')"
onmouseout="cs()">
<font size="+0">
New Computers & Hardware
</font>
</a>
I have tested the XPath string in oxygen and it works fine. I was told
on the Jaxen list that I need to map the html prefix to
http;//www.w3.org/1999/xhtml/namespace.
I'm not sure how to do that, especially when working with Jaxen from
within Dom4j. Can someone give me a quick example?
I'm currently getting the following error:
Exception in thread "main" org.dom4j.XPathException: Exception occurred
evaluting XPath: //html:[EMAIL PROTECTED]'aw1']. Exception: XPath expression uses
unbound namespace prefix html
at
org.dom4j.xpath.DefaultXPath.handleJaxenException(DefaultXPath.java:374)
at org.dom4j.xpath.DefaultXPath.selectNodes(DefaultXPath.java:134)
at org.dom4j.tree.AbstractNode.selectNodes(AbstractNode.java:166)
at util.Foo.bar(Foo.java:21)
at util.Foo.main(Foo.java:49)
Thanks!
Ray
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
dom4j-user mailing list
dom4j-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-user