Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] XOM 1.1: XPath

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Wolfgang Hoschek <whoschek AT lbl.gov>
  • To: "Michael Kay" <mike AT saxonica.com>
  • Cc: 'Elliotte Harold' <elharo AT metalab.unc.edu>, 'xom-interest' <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] XOM 1.1: XPath
  • Date: Sat, 8 Jan 2005 16:40:23 -0800

On Jan 8, 2005, at 1:46 AM, Michael Kay wrote:

public Nodes query(String xpath) throws ToBeDeterminedException
public Nodes query(String xpath, Map namespaceBindings)
throws ToBeDeterminedException


It occurred to me that you could handle expressions returning a string,
boolean, or number by wrapping the result in a specially-created Text node.
This would be better than offering only a restricted subset of XPath.

That would be possible, but probably overkill as it exposes a huge (W3C) type system that's rarely needed on output.
With Nux, the implicit conversions of atomic values to nodes on output are by default designed such that boolean, number, string, etc. can be nicely composed in orthogonal manners without the need of any convenience methods. As in:

int count = Integer.parseInt(new XQuery("count(//*)", null).execute(contextNode).next().getValue());







Archive powered by MHonArc 2.6.24.

Top of Page