Return-Path: Delivered-To: apmail-commons-issues-archive@locus.apache.org Received: (qmail 35148 invoked from network); 16 Aug 2007 21:49:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Aug 2007 21:49:57 -0000 Received: (qmail 3445 invoked by uid 500); 16 Aug 2007 21:49:52 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 3334 invoked by uid 500); 16 Aug 2007 21:49:52 -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 3290 invoked by uid 99); 16 Aug 2007 21:49:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Aug 2007 14:49:51 -0700 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; Thu, 16 Aug 2007 21:50:12 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 88190714201 for ; Thu, 16 Aug 2007 14:49:30 -0700 (PDT) Message-ID: <9131283.1187300970523.JavaMail.jira@brutus> Date: Thu, 16 Aug 2007 14:49:30 -0700 (PDT) From: "Vladimir (JIRA)" To: issues@commons.apache.org Subject: [jira] Created: (JXPATH-99) JXPath works incorrectly with CyberNeko HtmlParser MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org 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.