From user-return-19626-apmail-commons-user-archive=commons.apache.org@commons.apache.org Wed Jul 25 21:09:09 2007 Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 76567 invoked from network); 25 Jul 2007 21:09:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Jul 2007 21:09:08 -0000 Received: (qmail 1527 invoked by uid 500); 25 Jul 2007 21:09:04 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 1319 invoked by uid 500); 25 Jul 2007 21:09:04 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 1310 invoked by uid 99); 25 Jul 2007 21:09:04 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jul 2007 14:09:04 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [144.51.88.131] (HELO jazzdrum.ncsc.mil) (144.51.88.131) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Jul 2007 14:09:02 -0700 Received: from MSCS-GH1-UEA03.corp.nsa.gov (jazzdrum.ncsc.mil [144.51.5.7]) by jazzdrum.ncsc.mil (8.12.10/8.12.10) with ESMTP id l6PL8cjA004485 for ; Wed, 25 Jul 2007 21:08:39 GMT Received: from MSIS-GH1-UEA04.corp.nsa.gov ([10.215.228.136]) by MSCS-GH1-UEA03.corp.nsa.gov with Microsoft SMTPSVC(6.0.3790.1830); Wed, 25 Jul 2007 17:08:38 -0400 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: Problem with JXPath 1.3 - Registering Namespaces Date: Wed, 25 Jul 2007 17:08:37 -0400 Message-ID: <3839570ACE75F74EA214500F4F5FA29961DDF0@MSIS-GH1-UEA04.corp.nsa.gov> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Problem with JXPath 1.3 - Registering Namespaces Thread-Index: AcfO9L3RXezcA5hnTry9W+3UmFNuzgACQJSA From: "Mcduffey, Joe" To: "Jakarta Commons Users List" X-OriginalArrivalTime: 25 Jul 2007 21:08:38.0652 (UTC) FILETIME=[F89F4BC0:01C7CEFF] X-Virus-Checked: Checked by ClamAV on apache.org Matt, Thanks for getting back... There are 2 problems: 1. What steps should be taken if you have an default namespace defined? = see below MY VALUE I get no results from=20 JXPathContext.selectNodes("//ElementB"); However if I register a namespace as the default namespace uri I can get = my results: JXPathContext.registerNamespace("myns","urn:/myspace"); // Default = Namespace then query XPathContext.selectNodes("//myns:ElementB"); 2. The next problem is that I thought if I register namespaces e.g. =20 JXPathContext.registerNamespace(); Then I would not have to worry about the document not having them. = However when I call JXPathContext.registerNamespace("A","http://A"); JXPathContext.createPathAndSetValue("ElementA[1]/@A:mystuff,"value"); For the following MY VALUE I get an exception thrown saying A org.apache.common.ri.model.dom.DOMNodePointer.createAttribute unknown namespace prefix: A HELP! -----Original Message----- From: Matt Benson [mailto:gudnabrsam@yahoo.com] Sent: Wednesday, July 25, 2007 3:48 PM To: Jakarta Commons Users List Subject: RE: Problem with JXPath 1.3 - Registering Namespaces --- "Mcduffey, Joe" wrote: > I have an instance with a default namespace however > I cannot get any results from a selectNodes() call. > However if I register a namespaceNamespace("A", > "http://A/") with the Default namespace the query > works e.g. > JXpathContext.selectNodes(//A:Element) > but if I did not register the namespace and try to > run the query as=20 > JXpathContext.selectNodes(//Element) I get no > Results.=20 >=20 > HELP!!!!!!!!!!!!!!!! Whoa... calm down! :) I can't follow all that. Give me a breakdown of exactly how to evoke the (mis-)behavior you're seeing. Also, note that in a few minutes' time I'll be committing what is intended to fix your problems with createPathAndSetValue() for externally-registered namespaced attributes. -Matt >=20 > -----Original Message----- > From: Mcduffey, Joe [mailto:jdmcduf@nsa.gov] > Sent: Wednesday, July 25, 2007 11:37 AM > To: Jakarta Commons Users List > Subject: RE: Problem with JXPath 1.3 - Registering > Namespaces >=20 >=20 > Having a problem after registering a namespace as in > your example then executing the following: > - createPathAndSetValue(element/@A:attribute); >=20 > -----Original Message----- > From: Matt Benson [mailto:gudnabrsam@yahoo.com] > Sent: Wednesday, July 25, 2007 11:15 AM > To: Jakarta Commons Users List > Subject: RE: Problem with JXPath 1.3 - Registering > Namespaces >=20 >=20 > Joe: Did you test Sergey's patch or the latest 1.3 > trunk as of Tuesday afternoon/evening? As of that > time the svn trunk version worked for me against > your > submitted example. If not, please attach more code > which shows how to break the current ns handling and > reopen JXPATH-97 in JIRA. I'm trying to get all > bugs > resolved for a 1.3 release and this definitely > sounds > like something we want to have working properly. >=20 > Thanks, > Matt >=20 >=20 > --- "Mcduffey, Joe" wrote: >=20 > > This still doesn't work properly see previous > > message from 7/20/07... > >=20 > > ------------------ FROM PREVIOUS MESSAGE > > ------------------ > > After registering Namespaces in JXPath 1.3 and > then > > calling > > JXPathContext.createPathAndSetValue(key,value) > > I get an exception > > Unknown namespace prefix > >=20 > > However it had been successfully registered as I > > checked with the method call > > JXPathContext.getPrefix(); > >=20 > > Any help in this area????=20 > > ------------------ FROM PREVIOUS MESSAGE > > ------------------ > >=20 > > -----Original Message----- > > From: Sergey Vladimirov > [mailto:vlsergey@gmail.com] > > Sent: Saturday, July 21, 2007 10:12 AM > > To: Jakarta Commons Users List > > Subject: Re: Problem with JXPath 1.3 - Registering > > Namespaces > >=20 > >=20 > > Joe, > >=20 > > Please, look at the following issue and fix :) > > http://issues.apache.org/jira/browse/JXPATH-97 > >=20 > > --=20 > > Sergey > >=20 > >=20 > > 2007/7/16, Mcduffey, Joe : > > > > > > Can someone tell me how to register namespaces > so > > that attributes with > > > namespaces does not cause the exception > > > > > > > > > org.apache.common.ri.model.dom.DOMNodePointer.createAttribute > > > unknown namespace prefix: xsi > > > > > > For example the following > > > > > > MY VALUE > > > > > > > > > Would result in the following exception: > > > > > > org.apache.common.ri.model.dom.DOMNodePointer.createAttribute > > > unknown namespace prefix: A > > > > > > FYI: In this example there was a namespace > > decaration in the file and I > > > also manually called the > > > registerNamespace(A,"/http..."); > > > registerNamespace(B,"/http..."); > > > > > > There was no problem encountered for elements. > > Only attributes. Can > > > someone help? Thanks. > > > > > > > >=20 > >=20 > > --=20 > > Sergey Vladimirov > >=20 > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > > commons-user-unsubscribe@jakarta.apache.org > > For additional commands, e-mail: > > commons-user-help@jakarta.apache.org > >=20 > >=20 >=20 >=20 >=20 > =20 > _________________________________________________________________________= ___________ > Shape Yahoo! in your own image. Join our Network > Research Panel today! =20 > http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=3D7 >=20 >=20 >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: > commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: > commons-user-help@jakarta.apache.org >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: > commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: > commons-user-help@jakarta.apache.org >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: > user-unsubscribe@commons.apache.org > For additional commands, e-mail: > user-help@commons.apache.org >=20 >=20 = _________________________________________________________________________= ___________ Park yourself in front of a world of choices in alternative vehicles. = Visit the Yahoo! Auto Green Center. http://autos.yahoo.com/green_center/=20 --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@commons.apache.org For additional commands, e-mail: user-help@commons.apache.org