Return-Path: Delivered-To: apmail-commons-issues-archive@locus.apache.org Received: (qmail 55379 invoked from network); 14 Dec 2007 16:40:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Dec 2007 16:40:07 -0000 Received: (qmail 88561 invoked by uid 500); 14 Dec 2007 16:39:55 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 88494 invoked by uid 500); 14 Dec 2007 16:39:55 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 88484 invoked by uid 99); 14 Dec 2007 16:39:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Dec 2007 08:39:55 -0800 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Dec 2007 16:39:51 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 1A3E671420B for ; Fri, 14 Dec 2007 08:39:43 -0800 (PST) Message-ID: <27320087.1197650383095.JavaMail.jira@brutus> Date: Fri, 14 Dec 2007 08:39:43 -0800 (PST) From: "Matt Benson (JIRA)" To: issues@commons.apache.org Subject: [jira] Commented: (JXPATH-99) JXPath works incorrectly with CyberNeko HtmlParser In-Reply-To: <9131283.1187300970523.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/JXPATH-99?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12551853 ] Matt Benson commented on JXPATH-99: ----------------------------------- One more suggestion here: I noticed this FAQ on the Neko site: http://nekohtml.sourceforge.net/faq.html#uppercase > JXPath works incorrectly with CyberNeko HtmlParser > -------------------------------------------------- > > Key: JXPATH-99 > URL: https://issues.apache.org/jira/browse/JXPATH-99 > Project: Commons JXPath > Issue Type: Bug > Affects Versions: 1.2 Final > Reporter: Vladimir > > I don't know exactly where is the bug. I have an idea, that CyberNeko html parser creates some wired w3c DOM representation of html file, and that is the cause. Here is a code sample: > // --------------------------- > // create CyberNeko html parser > DOMParser parser = new DOMParser(); > // this page does have //input[@name='q'] field > parser.parse("http://google.com"); > Document doc = parser.getDocument(); > // JXPATH TEST > JXPathContext context = JXPathContext.newContext(doc); > List nodes1 = context.selectNodes("//input[@name='q']"); // ERROR IS HERE: call returns nothing, must return 1 node > List nodes2 = context.selectNodes("//*"); // returnes 78 nodes > System.out.println(nodes1.toString()); > System.out.println(nodes2.toString()); > // XPathFactory TEST ( for comparison ) > // error, returns nothing > Object list1 = XPathFactory.newInstance().newXPath().compile("//input[@name='q']").evaluate(doc, XPathConstants.NODESET); > // returns 79 nodes > Object list2 = XPathFactory.newInstance().newXPath().compile("//*").evaluate(doc, XPathConstants.NODESET); > System.out.println(list1); > System.out.println(list2); > // ----------------------------------- > Is it possible to fix this problem inside JXPath? Or is it only html parser problem? -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.