Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] unable to get xquery to work

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Tatu Saloranta <cowtowncoder AT yahoo.com>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] unable to get xquery to work
  • Date: Fri, 4 Apr 2008 21:23:50 -0700 (PDT)

--- William Chu <willchu AT gmail.com> wrote:

> Hi,
>
> Thank you for the help! But when I try the following
>
> String xqueryScript = "/xhtml:html";
>
> on the page:
> String page = "<html>hi</html>";
>
> I get an exception:
>
> java.lang.RuntimeException:
> nux.xom.xquery.XQueryException:
> net.sf.saxon.trans.StaticError: XQuery static error
> in #/xhtml:html#:
> Prefix xhtml has not been declared
> at

Right. Because you have not declared what namespace
prefix 'xhmtl' might refer to. Add namespace binding
to the xpath and it'll work.
(and "how" part is a FAQ for xpath implementation that
you use)

-+ Tatu +




____________________________________________________________________________________
You rock. That's why Blockbuster's offering you one month of Blockbuster
Total Access, No Cost.
http://tc.deals.yahoo.com/tc/blockbuster/text5.com




Archive powered by MHonArc 2.6.24.

Top of Page