Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] XPath Data Model Mapping

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: John Cowan <jcowan AT reutershealth.com>
  • To: Elliotte Harold <elharo AT metalab.unc.edu>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] XPath Data Model Mapping
  • Date: Mon, 17 Jan 2005 14:12:45 -0500

Elliotte Harold scripsit:

> >distinct adjacent XPath text nodes in the result.
>
> There's no such thing as "adjacent XPath text nodes". This simply does
> not exist in the XPath data model. The results returned do contain
> properly ordered, adjacent XOM Text objects.

It's true that there are no adjacent XPath text nodes in the data model,
but that does not mean that the (document ordered) result cannot contain
consecutive text nodes. For example, the XPath "//text()" returns
multiple nodes (with trivial exceptions), but there is no easy way of
knowing what the boundaries between them are.

> XOM does not expose any public API for counting XPath nodes. XOM counts
> XOM nodes and XPath counts XPath nodes. They are not the same thing.

You have said that it is not important to allow XPaths like count(//)
because you can just evaluate // and count the results in Java. But this
will not work for count(//text()).

> We're arguing off on the edges here. I think most users are going to
> ignore this completely and get exactly the results they expect.

Until they are using a synthetic XOM document rather than one built by
Builder, and get bizarre results.

--
[W]hen I wrote it I was more than a little John Cowan
febrile with foodpoisoning from an antique carrot
jcowan AT reutershealth.com
that I foolishly ate out of an illjudged faith www.ccil.org/~cowan
in the benignancy of vegetables. --And Rosta www.reutershealth.com




Archive powered by MHonArc 2.6.24.

Top of Page