xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
- From: "William Chu" <willchu AT gmail.com>
- To: elharo AT metalab.unc.edu
- Cc: xom-interest AT lists.ibiblio.org
- Subject: Re: [XOM-interest] unable to get xquery to work
- Date: Fri, 4 Apr 2008 18:49:22 -0700
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 nux.xom.xquery.XQueryUtil.xquery(XQueryUtil.java:107)
at soup.Soup.main(Soup.java:29)
Caused by: nux.xom.xquery.XQueryException:
net.sf.saxon.trans.StaticError: XQuery static error in #/xhtml:html#:
Prefix xhtml has not been declared
at nux.xom.xquery.XQuery.<init>(XQuery.java:393)
at nux.xom.pool.XQueryFactory.createXQuery(XQueryFactory.java:165)
at nux.xom.pool.XQueryPool.getXQuery(XQueryPool.java:227)
at nux.xom.xquery.XQueryUtil.xquery(XQueryUtil.java:105)
... 1 more
Caused by: net.sf.saxon.trans.StaticError: XQuery static error in
#/xhtml:html#:
Prefix xhtml has not been declared
at net.sf.saxon.query.QueryParser.grumble(QueryParser.java:319)
at
net.sf.saxon.expr.ExpressionParser.makeNameCode(ExpressionParser.java:2147)
at
net.sf.saxon.expr.ExpressionParser.makeNameTest(ExpressionParser.java:2173)
at
net.sf.saxon.expr.ExpressionParser.parseNodeTest(ExpressionParser.java:1385)
at
net.sf.saxon.expr.ExpressionParser.parseBasicStep(ExpressionParser.java:1281)
at
net.sf.saxon.expr.ExpressionParser.parseStepExpression(ExpressionParser.java:1166)
at
net.sf.saxon.expr.ExpressionParser.parseRemainingPath(ExpressionParser.java:1138)
at
net.sf.saxon.expr.ExpressionParser.parsePathExpression(ExpressionParser.java:1061)
at
net.sf.saxon.expr.ExpressionParser.parseUnaryExpression(ExpressionParser.java:971)
at
net.sf.saxon.expr.ExpressionParser.parseCastExpression(ExpressionParser.java:636)
at
net.sf.saxon.expr.ExpressionParser.parseCastableExpression(ExpressionParser.java:605)
at
net.sf.saxon.expr.ExpressionParser.parseTreatExpression(ExpressionParser.java:586)
at
net.sf.saxon.expr.ExpressionParser.parseInstanceOfExpression(ExpressionParser.java:568)
at
net.sf.saxon.expr.ExpressionParser.parseIntersectExpression(ExpressionParser.java:1004)
at
net.sf.saxon.expr.ExpressionParser.parseUnionExpression(ExpressionParser.java:986)
at
net.sf.saxon.expr.ExpressionParser.parseMultiplicativeExpression(ExpressionParser.java:923)
at
net.sf.saxon.expr.ExpressionParser.parseAdditiveExpression(ExpressionParser.java:903)
at
net.sf.saxon.expr.ExpressionParser.parseRangeExpression(ExpressionParser.java:819)
at
net.sf.saxon.expr.ExpressionParser.parseComparisonExpression(ExpressionParser.java:769)
at
net.sf.saxon.expr.ExpressionParser.parseAndExpression(ExpressionParser.java:380)
at
net.sf.saxon.expr.ExpressionParser.parseOrExpression(ExpressionParser.java:362)
at
net.sf.saxon.expr.ExpressionParser.parseExprSingle(ExpressionParser.java:316)
at
net.sf.saxon.expr.ExpressionParser.parseExpression(ExpressionParser.java:280)
at net.sf.saxon.query.QueryParser.parseQuery(QueryParser.java:252)
at
net.sf.saxon.query.QueryParser.makeXQueryExpression(QueryParser.java:103)
at
net.sf.saxon.query.StaticQueryContext.compileQuery(StaticQueryContext.java:475)
at nux.xom.xquery.XQuery.<init>(XQuery.java:391)
... 4 more
On Fri, Apr 4, 2008 at 6:30 AM, Elliotte Harold <elharo AT metalab.unc.edu>
wrote:
> William Chu wrote:
>
> > Hello,
> >
> > I am trying to apply a simple xquery to a very basic page.
> >
> > The query is this: /html
> >
> >
>
> That's your problem, I expect. It should be something like /xhtml:html
> where xhtml is mapped to the XHTML namespace. If I recall correctly, TagSoup
> reports all elements in the XHTML namespace.
>
> --
> Elliotte Rusty Harold elharo AT metalab.unc.edu
> Java I/O 2nd Edition Just Published!
> http://www.cafeaulait.org/books/javaio2/
> http://www.amazon.com/exec/obidos/ISBN=0596527500/ref=nosim/cafeaulaitA/
>
-
[XOM-interest] unable to get xquery to work,
William Chu, 04/04/2008
-
Re: [XOM-interest] unable to get xquery to work,
Elliotte Harold, 04/04/2008
-
Re: [XOM-interest] unable to get xquery to work,
William Chu, 04/04/2008
- Re: [XOM-interest] unable to get xquery to work, Tatu Saloranta, 04/05/2008
- Re: [XOM-interest] unable to get xquery to work, Michael Kay, 04/05/2008
-
Re: [XOM-interest] unable to get xquery to work,
William Chu, 04/04/2008
-
Re: [XOM-interest] unable to get xquery to work,
Elliotte Harold, 04/04/2008
Archive powered by MHonArc 2.6.24.