xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
Re: [XOM-interest] Xpath that returns numeric values
- From: Christophe Marchand <christophe.marchand AT axyus.com>
- To: xom-interest AT lists.ibiblio.org
- Subject: Re: [XOM-interest] Xpath that returns numeric values
- Date: Fri, 24 Feb 2012 08:24:06 +0100
That's what I've done.
Thanks Elliotte
Le 23/02/2012 18:21, Elliotte Rusty Harold a écrit :
On Wed, Feb 22, 2012 at 12:30 PM, Christophe Marchand
<christophe.marchand AT axyus.com> wrote:
Hi !This is working as intended. Java's strict typing really doesn't deal
Element.query("count(//document[@imported])"); throws this exception :
nu.xom.XPathTypeException: XPath expression count(//document[@imported])
returned a java.lang.Double instead of a node-set.
at nu.xom.JaxenConnector.selectNodes(Unknown Source)
at nu.xom.Node.query(Unknown Source)
at nu.xom.Node.query(Unknown Source)
Is there a workaround, or should I use
Element.query("count(//document[@imported])").size() instead ?
Which workaround for avg(...) functions ?
well with XPath's loose typing. The workaround is to do math in Java
rather than in XPath.
-
[XOM-interest] Xpath that returns numeric values,
Christophe Marchand, 02/23/2012
-
Re: [XOM-interest] Xpath that returns numeric values,
Elliotte Rusty Harold, 02/23/2012
- Re: [XOM-interest] Xpath that returns numeric values, Christophe Marchand, 02/24/2012
-
Re: [XOM-interest] Xpath that returns numeric values,
Elliotte Rusty Harold, 02/23/2012
Archive powered by MHonArc 2.6.24.