XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Roger PowellSubject: Newbie Xquery problem to solve
Author: Roger Powell
Date: 04 Jan 2005 12:02 PM
I copied this example from the XQuery book by Michael Brundage (Addison Wesley). Page 14, fig 1.7

I have added variable declarations (missing from the book) and a different namespace declaration.

StylusStudio gives the error message: "Variable my:n does not exist."
But my:n is declared inside the argument of my:fact -- not correct?

I also get errors if I try to declare the variable (globally) outside the argument.
The example, copied verbatim, also gives errors.

(: Sample version 1.0 :)
declare namespace my = "http://www.brunel.ac.uk/~emstrsp";
declare function my:fact($my:n as xs:integer) as xs:integer
{
if ($my:n < 2)
then 1
else $my:n * my:fact($my:n-1)
};
declare variable $ten as xs:integer := my:fact(10);
<table>{
for $i in 1 to 10
return
<tr>
<td>10!/{$i}! = {$ten div my:fact($i)}</td>
</tr>
}</table>

Thanks,
Senior Lecturer, Brunel University

Postnext
(Deleted User) Subject: Re: Newbie Xquery problem to solve
Author: (Deleted User)
Date: 04 Jan 2005 03:41 PM
Originally Posted: 04 Jan 2005 03:35 PM
Hi Roger,
what you are hitting is a bug in the XQuery processor, triggered by the
fact that the variable definition is invoking a user-defined function that
hasn't been fully constructed.
A fix for this problem will be available in the upcoming 6.1 release.

Thanks for reporting this,
Alberto


Postnext
Roger PowellSubject: Re: Newbie Xquery problem to solve
Author: Roger Powell
Date: 05 Jan 2005 04:58 AM
Many thanks to you and your daughter.

Any ideas when this update is scheduled for release?

Roger.
Senior Lecturer, Brunel University

Postnext
Minollo I.Subject: Re: Newbie Xquery problem to solve
Author: Minollo I.
Date: 05 Jan 2005 08:55 AM
6.1 is being release on 1/11.

Thanks,
Minollo

Postnext
Roger PowellSubject: Re: Newbie Xquery problem to solve
Author: Roger Powell
Date: 13 Jan 2005 07:36 AM
Thank you. V6.1 does indeed solve this XQuery problem.

That is, after I had fixed the following XQG "XQuery gotcha":
$my:n * my:fact($my:n-1)
to
$my:n * my:fact($my:n -1)

Best wishes,
Roger
Senior Lecturer, Brunel University

Postnext
David JaramilloSubject: Re: Newbie Xquery problem to solve
Author: David Jaramillo
Date: 19 Jan 2005 08:12 AM
Where can version 6.1 be downloaded?
I'm using v6.0 Build 212i. The update manager says:
"you are currently running the latest version.."

Thanks.
David

Posttop
Minollo I.Subject: Re: Newbie Xquery problem to solve
Author: Minollo I.
Date: 19 Jan 2005 09:03 AM
If you are connected to the internet, the update manager should be telling
you that 6.1 is available; it may be a caching/proxy issue.

Anyway, the latest 6.x release is available at:
http://www.stylusstudio.com/update

Thanks,
Minollo

 
Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.