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: "Michael Kay" <mike AT saxonica.com>
  • To: "'William Chu'" <willchu AT gmail.com>, <elharo AT metalab.unc.edu>
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] unable to get xquery to work
  • Date: Sat, 5 Apr 2008 16:00:00 +0800

>
> 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

The error message means exactly what it says. So declare the namespace:

declare namespace xhtml="...."; /xhtml:html

Michael Kay
http://www.saxonica.com/





Archive powered by MHonArc 2.6.24.

Top of Page