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
Juan AlfonsoSubject: Error in Xquery V3.0
Author: Juan Alfonso
Date: 16 May 2007 05:25 PM
Error That didn't happen in Xquery 2.0 SP1

1com.ddtek.xquery.XQException: [DataDirect][XQuery
][err:XPTY0004]An empty sequence does not match the type xs:string as specified
by the Sequence Type Matching rules.

Postnext
Minollo I.Subject: Error in Xquery V3.0
Author: Minollo I.
Date: 16 May 2007 05:34 PM
Juan,
any chance you can give us some more context about this error? Also, you may want to consider using the formal DataDirect XQuery support channel for specific DataDirect XQuery issues you need to report.

Thanks.

Postnext
Mr BeanSubject: Error in Xquery V3.0
Author: Mr Bean
Date: 23 May 2007 12:00 PM
This might be an example:
//video[actorRef=//actors/actor[ends-with(., 'Lisa')]/@id]/title

This is from the online tutorial at http://www.stylusstudio.com/xquery_primer.html
Instead of giving the expected result:
<title>Enemy of the State</title>
<title>Clerks</title>
I get this:
[DataDirect][XQuery][err:XPTY0004]Error at line 1, column 43. Static type error. Type 'element(actor, xs:anyType)' is not valid for argument 1 of function 'fn:ends-with'. Required type is 'xs:string?'. [Call stack: fn:ends-with@1.33]

Can't figure out the reason

Postnext
Minollo I.Subject: Error in Xquery V3.0
Author: Minollo I.
Date: 23 May 2007 12:51 PM
Static type checking in DataDirect XQuery is stricter than in the Stylus Studio built-in processor; you would have to change that expression into:

//video[actorRef=string(//actors/actor[ends-with(text(), 'Lisa')][1]/@id)]/title

You shouldn't need to do that if the static context was bound as document-node(element(*, xs:untyped)); we are investigating to see if that's a problem in Stylus Studio. The original expression would work with DataDirect XQuery 3.0 without change in this case:

declare variable $d as document-node(element(*, xs:untyped)) external;
$d//video[actorRef=$d//actors/actor[ends-with(., 'Lisa')]/@id]/title

Postnext
Mr BeanSubject: Error in Xquery V3.0
Author: Mr Bean
Date: 23 May 2007 03:02 PM
Thanks for the quick response. Some improvement though not the exact expected result. May I suggest that S.S. retest the tutorial code against the latest download (just pasting the snipets and checking the result). It doesn't seem to work out in every case as described in the tutorial, which would indicate that it needs revision.

Postnext
Minollo I.Subject: Error in Xquery V3.0
Author: Minollo I.
Date: 23 May 2007 03:11 PM
No doubt the tutoria needs a revision; we are in the process of reviewing the material on the website.

BTW, another (maybe simpler) way to workaround the difference in processors and static typing, is to change the initial "//"'s in XPath expression with ".//"

Posttop
Mr BeanSubject: Error in Xquery V3.0
Author: Mr Bean
Date: 24 May 2007 03:20 AM
Thanks for the quick response. Some improvement though not the exact expected result. May I suggest that S.S. retest the tutorial code against the latest download (just pasting the snipets and checking the result). It doesn't seem to work out in every case as described in the tutorial, which would indicate that it needs revision.

 
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.