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: Elliotte Harold <elharo AT metalab.unc.edu>
  • Cc: xom-interest AT lists.ibiblio.org, John Cowan <jcowan AT reutershealth.com>
  • Subject: Re: [XOM-interest] XOM 1.1: XPath
  • Date: Thu, 6 Jan 2005 15:03:49 -0800

On Jan 6, 2005, at 2:55 PM, Elliotte Harold wrote:

John Cowan wrote:

Neither XOM nor XPath has any notion of the default namespace (an NCName
in an XPath refers to the namespace named "", not anything else --
a frequent source of bugs in XPaths).


My point here is that when querying a document that uses the default namespace (e.g. XHTML) you have to use a prefix in the XPath expression, and that prefix will generally not be declared in the document you're querying, so some additional namespace binding is required, especially if you don't want to modify the document being queried. Sorry if I didn't say that quite right the first time, but that's the issue: how do you query a document that uses default namespaces.

Via "prefix:foo/prefix:bar/prefix:baz", so namespace info needs to be passed to the query.
In Nux namespaces can be declared in the standard XQuery prolog or dynamically bound via the StaticContext of saxon-8.2.

Wolfgang,.





Archive powered by MHonArc 2.6.24.

Top of Page