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

Michael Rys mrys at microsoft.com
Mon Dec 6 14:01:44 PST 2004


You can only cast to an atomic type.

You want to use treat as instead.

Best regards
Michael

> -----Original Message-----
> From: talk-bounces at xquery.com [mailto:talk-bounces at xquery.com] On
Behalf
> Of Alex
> Sent: Monday, December 06, 2004 12:21 PM
> 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