Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] XOM 1.2.8 released

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Rusty Harold <elharo AT ibiblio.org>
  • To: XOM API for Processing XML with Java <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] XOM 1.2.8 released
  • Date: Mon, 14 May 2012 11:43:43 -0700

On Mon, May 14, 2012 at 10:55 AM, Regier Avery J
<RegierAveryJ AT johndeere.com> wrote:
> Yet I can still do it.


Yes, what you can't now do (and used to be able to) is bind the
null/empty prefix to a namespace URI.

The prefixes in XPath expressions do not have to be the same as the
prefixes (or lack thereof) in the queried document.


>        public void testNotWithNamespace() throws ValidityException,
> ParsingException, IOException {
>                Document doc = new Builder().build(new StringReader("<hi
> xmlns='there://mr.space/alien'/>"));
>                XPathContext context =
> XPathContext.makeNamespaceContext(doc.getRootElement());
>                context.addNamespace("a",
> doc.getRootElement().getNamespaceURI());
>                Nodes query = doc.query("//*[not(self::a:human)]", context);
>                assertEquals(1, query.size());
>        }
>
>
> I am quite happy that this now works:
>
>
> Avery J. Regier
> IVS Solutions Infrastructure Technical Architect
> Work: 515 331-9905 / Cell: 309 781-1366
> RegierAveryJ AT JohnDeere.com
>
>
> -----Original Message-----
> From: xom-interest-bounces AT lists.ibiblio.org
> [mailto:xom-interest-bounces AT lists.ibiblio.org] On Behalf Of Elliotte Rusty
> Harold
> Sent: Monday, May 14, 2012 12:49 PM
> To: XOM API for Processing XML with Java
> Subject: Re: [XOM-interest] XOM 1.2.8 released
>
> As Michael surmised, that's a deliberate bug fix. You should no longer
> need to bind anything to the default namespace.
>
> --
> Elliotte Rusty Harold
> elharo AT ibiblio.org
> _______________________________________________
> XOM-interest mailing list
> XOM-interest AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/xom-interest
> _______________________________________________
> XOM-interest mailing list
> XOM-interest AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/xom-interest



--
Elliotte Rusty Harold
elharo AT ibiblio.org




Archive powered by MHonArc 2.6.24.

Top of Page