Return-Path: Delivered-To: apmail-forrest-dev-archive@www.apache.org Received: (qmail 51995 invoked from network); 31 Oct 2005 23:31:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 31 Oct 2005 23:31:16 -0000 Received: (qmail 77215 invoked by uid 500); 31 Oct 2005 23:31:15 -0000 Delivered-To: apmail-forrest-dev-archive@forrest.apache.org Received: (qmail 77188 invoked by uid 500); 31 Oct 2005 23:31:15 -0000 Mailing-List: contact dev-help@forrest.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@forrest.apache.org List-Id: Delivered-To: mailing list dev@forrest.apache.org Received: (qmail 77177 invoked by uid 99); 31 Oct 2005 23:31:15 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Oct 2005 15:31:15 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [165.98.153.184] (HELO ags01.agssa.net) (165.98.153.184) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Oct 2005 15:31:11 -0800 Received: from [10.0.0.7] (apoyo.agssa.net [10.0.0.7]) by ags01.agssa.net (8.13.1/8.13.1) with ESMTP id j9VNUjZB022004 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 31 Oct 2005 17:30:50 -0600 Message-ID: <4366A925.30407@agssa.net> Date: Mon, 31 Oct 2005 17:30:45 -0600 From: Antonio Gallardo Organization: AG Software, S. A. User-Agent: Mozilla Thunderbird 1.0.7-1.1.fc4 (X11/20050929) X-Accept-Language: en-us, en MIME-Version: 1.0 To: dev@forrest.apache.org Subject: Re: [jira] Commented: (FOR-675) upgrading to commons-jxpath-1.2.jar causes failures with linkrewriter protocols site: etc. References: <555203221.1130653618744.JavaMail.jira@ajax.apache.org> <43646C4F.7020502@agssa.net> <43648542.2010901@agssa.net> <20051031052733.GA10630@igg.indexgeo.com.au> <20051031102131.GA12535@igg.indexgeo.com.au> In-Reply-To: <20051031102131.GA12535@igg.indexgeo.com.au> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass (ags01.agssa.net: 10.0.0.7 is whitelisted) receiver=ags01.agssa.net; client-ip=10.0.0.7; helo=[10.0.0.7]; envelope-from=agallardo@agssa.net; x-software=spfmilter 0.93 http://www.acme.com/software/spfmilter/; X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N David Crossley wrote: >David Crossley wrote: > > >>Antonio Gallardo wrote: >> >> >>>Antonio Gallardo wrote: >>> >>> >>>>Antonio Gallardo (JIRA) wrote: >>>> >>>> >>>> >>>>>Can somebody update cocoon jars in Forrest, revert the workaround and >>>>>check if the bug is fixed. ;-) >>>>> >>>>> >>>>> >>>>Ok. I am going to update cocoon 2.2 in forrest..... :-) >>>> >>>> >>>Can someone take this task? I was unable to follow the instructions in >>>etc/cocoon_upgrade there is a problem with the XSP block. :-( >>> >>> >>I too had that trouble a few days ago trying to do a Cocoon >>upgrade. Today i was successful. >> >>And you will be pleased to know that i tested your fix >>for JXPath and everything works. Thankyou so much Antonio. >> >>I will commit the upgrade later today or tommorrow. >> >> > >Uh'oh, looks like we are one step ahead of ourselves. > >See the comments at the Commons JXPath issue: >http://issues.apache.org/bugzilla/show_bug.cgi?id=32360 > >Also elharo kindly added a note to the Cocoon bug >warning that we might have the wrong fix: >http://issues.apache.org/bugzilla/show_bug.cgi?id=36810 > > I wonder why he claims we broke the JXPath implementation. I understand the new method in jxpath is a hack, but..... Well, I think we are learning and that is good. :-) If this is the case, we can try the suggested solution: Given a simple linkmap.xml as: ** * Then the xpath expression "/site/index/@href" cannot be used. It returns null. The reason is below. *The real difficulty is that XPath syntax needs to satisfy two irreconcilable requirements: handling elements in a declared but default (unprefixed) namespace and handling elements in no namespace at all, which do not have expanded names. In reconciling this dilemma, the XPath spec says that an unprefixed name /in an XPath expression/ is assumed to be in an undeclared namespace, even when the name as it appears /in the instance document/ has (as a result of a namespace declaration) an expanded name. Thus, |//myIndex| "query" is instructing XPath to locate an element which does not exist, a |"myIndex"| element in an undeclared namespace. * One of the suggested solutions in the document is strip the default namespace form the file. (This was the David solution). If the above is not posible, then we can also make a simple trick with JXPath: *context.registerNamespace(foo, "http://apache.org/cocoon/linkmap/1.0 "); and then write the xpath using it: *"/foo:site/foo:index/@href"* * Best Regards, Antonio Gallardo. *