Do you have a sample XHTML document that reproduces the problem. I've tried writing a test case using the example you gave but it works fine for me. Its included below...
The exception you're getting does look like an old version of Jaxen. Could it be? I've tested this against the daily build and 1.0 of dom4j and it appears to work fine. James public void testRobLebowitz() throws Exception { String text = "<ul>" + " <ul>" + " <li/>" + " <ul>" + " <li/>" + " </ul>" + " <li/>" + " </ul>" + "</ul>"; Document document = DocumentHelper.parseText( text ); List lists = document.selectNodes( "//ul | //ol" ); int count = 0; for (int i = 0; i < lists.size(); i++) { Element list = (Element)lists.get(i); List nodes = list.selectNodes("ancestor::ul"); if ((nodes != null) && (nodes.size() > 0)) { continue; } nodes = list.selectNodes("ancestor::ol"); if ((nodes != null) && (nodes.size() > 0)) { continue; } } } ----- Original Message ----- From: "Robert J. Lebowitz" <[EMAIL PROTECTED]> To: "Brain, Jim" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Friday, December 07, 2001 10:58 PM Subject: Re: [dom4j-user] xpath problem, a clue to the problem. > Actually, after "fixing" the html, I still continue to have the problem of > the null pointer exception. I can't figure out what is causing it. In the > interim, I just wrapped the code that throws the exception with a try/catch > clause and ignore the exception. > > I'm still a bit puzzled about how to rename elements however. As far as I > can tell from the API, there are some situations where a node is read-only, > and you can't modify it's contents. > > As near as I can tell, you are forced to create a new document, and stick in > the nodes you want in their appropriate locations if you want to rename > them. With large documents this is prohibitively difficult.... I'm curious > why the setName() method can't be used. > > > > > _______________________________________________ > dom4j-user mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/dom4j-user > _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com _______________________________________________ dom4j-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dom4j-user