[XOM-interest] unable to get xquery to work

Tatu Saloranta cowtowncoder at yahoo.com
Sat Apr 5 00:23:50 EDT 2008


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


More information about the XOM-interest mailing list