Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] namespaces and the not() function

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] namespaces and the not() function
  • Date: Fri, 4 May 2012 20:50:38 -0400

I've fixed the one you reported as a bug in my local client. I think
your workaround should also fail:

public void testNotWithNamespaceWorkaround() throws
ParsingException, IOException {

Document doc = new Builder().build(new StringReader("<root
xmlns='http://www.example.org'/>"));
XPathContext context =
XPathContext.makeNamespaceContext(doc.getRootElement());
context.addNamespace("a", doc.getRootElement().getNamespaceURI());
context.addNamespace("f", "");
Nodes query = doc.query("//*[f:not(self::a:test)]", context);
assertEquals(1, query.size());

}

I.e. "//*[f:not(self::a:test)]" is not a correct XPath 1.0 expression,
at least not when f is bound to the empty string.

Michael, what do you think?

--
Elliotte Rusty Harold
elharo AT ibiblio.org




Archive powered by MHonArc 2.6.24.

Top of Page