[xquery-talk] Is cast as node() valid syntax?

Michael Kay mhk at mhk.me.uk
Mon Dec 6 23:16:47 PST 2004


You can only cast to an atomic type.

If you had this syntax, what would you expect it to do?

Perhaps you were looking for "treat as"?

Michael Kay
http://www.saxonica.com/ 

> -----Original Message-----
> From: talk-bounces at xquery.com 
> [mailto:talk-bounces at xquery.com] On Behalf Of Alex
> Sent: 06 December 2004 20:21
> To: talk at xquery.com
> Subject: [xquery-talk] Is cast as node() valid syntax?
> 
> Hi,
> 
> Does the following XQuery have valid syntax:
> 
> <out>{ fn:doc("input.xml")/* cast as node()* }</out>
> 
> Saxon 8.0b returns the following error:
>   XQuery syntax error on line 1 in `...("input.xml")/* cast 
> as node()`:
>     expected "<name>", found "<node-type>()"
> 
> If this is incorrect, what is the right way to cast to a node type or 
> node type sequence? Please note that cast for the above XQuery is 
> redundant, but it might be required in more complex situations.
> 
> thanks,
> Alex
> 
> -- 
> 
> _______________________________________________
> talk at xquery.com
> http://xquery.com/mailman/listinfo/talk
> 



More information about the talk mailing list