Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] New XPath issue: what to do with non-nodes?

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Michael Abato <mrabato AT earthlink.net>
  • To: "Michael Kay" <mike AT saxonica.com>
  • Cc: xom-interest <xom-interest AT lists.ibiblio.org>
  • Subject: Re: [XOM-interest] New XPath issue: what to do with non-nodes?
  • Date: Thu, 13 Jan 2005 08:36:04 -0500

Another reason a developer may prefer XPath over java code is that it allows you to move the details of the data model into declarative configuration. This is particularly appealing in IoC/DI infrastructures (SpringFramework, PicoContainer, HiveMind, etc.) which bind objects at runtime and minimize concrete object coupling. Moving the XPath expression external decouples runtime objects from the concrete data model as well.

I would certainly include mathematical (numeric/boolean) results in this scenario, and would much prefer type-safe results over string-ification.

Michael Abato

On Jan 13, 2005, at 4:05 AM, Michael Kay wrote:


Elliotte Harold scripsit:

What XPath 1.0 expressions might you use
in a Java program that do not return node-sets?

I can't think of any.

I think you're assuming a scenario where users like to code in Java and only
use XPath as a last resort. There's another scenario where users hate coding
in Java (all those fiddly iterators) and like to use XPath as much as
possible. There's also a scenario where the Java application with embedded
XPath is machine-generated.

sum(*[@code=23]/@value)
lang('de')
count(../following-sibling::foo) = 0

Michael Kay
http://www.saxonica.com

_______________________________________________
XOM-interest mailing list
XOM-interest AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/xom-interest






Archive powered by MHonArc 2.6.24.

Top of Page