[xquery-talk] Parse error - please help!

Priscilla Walmsley priscilla at walmsley.com
Wed Dec 1 15:50:23 PST 2004


Hi,

I'm copying this back to the list....

Saxon 8.1.1 can parse the query you have below.  Perhaps either your
processor is buggy, or it supports some previous version of XQuery.
Unfortunately, since the error message is vague, it's hard to tell which it
is.

Priscilla

-----------------------------------------------------
Priscilla Walmsley             priscilla at walmsley.com
Author, Definitive XML Schema     (Prentice Hall PTR)
-----------------------------------------------------  

> -----Original Message-----
> From: padmapriya ayyagari [mailto:asn.padmapriya at gmail.com] 
> Sent: Wednesday, December 01, 2004 3:35 PM
> To: Priscilla Walmsley
> Subject: Re: [xquery-talk] Parse error - please help!
> 
> Hello Priscilla,
> 
> Thanks for hte help. But even after removing hte local namespace
> declaration, this still gives the same parse error! Even on changing
> hte default function namespace and appending fn: to the functions
> concat, and name, it still gave the same error.
> 
> declare function local:fullpath($node as node()) as xs:string
>  {
>  if ($node/..) then concat(name($node), '/', local:fullpath($node/..))
>  else ""
>  };
> local:fullpath(fn:doc("xmark.xml")//site/people/person/emailaddress)
> galapi.GalapiException: Failure("Parsing Error: Parse error in XQuery
> string [characters 8-16:]")
> 
> Thanks,
> Padmapriya
> 
> On Wed, 1 Dec 2004 14:54:40 -0500, Priscilla Walmsley
> <priscilla at walmsley.com> wrote:
> > Hi,
> > 
> > You need to prefix the concat and name functions with fn:, 
> since you are
> > changing the default function namespace. (Why are you doing 
> that by the
> > way?)
> > 
> > Also, there is no function named "document" - it is "doc".
> > 
> > Hope that helps,
> > Priscilla
> > -----------------------------------------------------
> > Priscilla Walmsley             priscilla at walmsley.com
> > Author, Definitive XML Schema     (Prentice Hall PTR)
> > -----------------------------------------------------  
> > 
> > 
> > 
> > > -----Original Message-----
> > > From: talk-bounces at xquery.com
> > > [mailto:talk-bounces at xquery.com] On Behalf Of padmapriya ayyagari
> > > Sent: Wednesday, December 01, 2004 2:15 PM
> > > To: talk at xquery.com
> > > Subject: [xquery-talk] Parse error - please help!
> > >
> > > Hello,
> > >
> > > When I try to execute the following xquery:
> > >
> > > declare default function namespace
> > > "http://www.w3.org/2004/10/xquery-local-functions";
> > >
> > > declare function local:fullpath($node as node()) as xs:string
> > >  {
> > >        if ($node/..) then concat(name($node), '/',
> > > local:fullpath($node/..))
> > >        else ""
> > >  };
> > >
> > > local:fullpath(fn:document("xmark.xml")//site/people/person/em
> > > ailaddress)
> > >
> > > It gives me the following error :
> > >
> > > Exception in thread "main" galapi.GalapiException: 
> Failure("Parsing
> > > Error: Parse error in XQuery string [characters 8-24:]")
> > >
> > > Similarly for the function below:
> > >
> > > declare default function namespace
> > > "http://www.w3.org/2004/10/xquery-local-functions";
> > > declare function local:getmypath($e as node()) as xs:string
> > >  {
> > >   concat('/', string-join(for $n in ancestor-or-self::*
> > > return name($n), '/'))
> > > };
> > >  
> local:getmypath(fn:doc("xmark.xml")//site/people/person/emailaddress)
> > > Exception in thread "main" galapi.GalapiException: 
> Failure("Parsing
> > > Error: Parse error in XQuery string [characters 8-24:]")
> > >
> > > To tbe best of my knowledge, the syntax is in tune with the w3
> > > specifications. Could someone please point out what the 
> error might
> > > be?
> > >
> > > Thanks,
> > > Padmapriya
> > > _______________________________________________
> > > talk at xquery.com
> > > http://xquery.com/mailman/listinfo/talk
> > >
> > 
> >
> 




More information about the talk mailing list