
Hello Roy, One of the things about MonetDB/XQuery that it does static typing. So the compiler tries to figure out the cardinality of "$res/../@speakername" and cannot know whether it happens 0 or more times, and will therefore not be able to detect whether there is exactly one speakername attribute matching this query. Because xs:string will need exactly 1 argument, you need to either give a hint that there will be exactly one attribute, or otherwise pass each speakername attribute to the function. So either: <p>{xs:string(exactly-one($res/../@speakername))}: {$res}</p> or: <p>{for $i in $res/../@speakername return xs:string($i)}: {$res}</p> should work. If not, please give us some insight in the error which was returned. Hope this helps, Wouter 2009/8/5 Roy Walter <garliestonhouse@yahoo.co.uk>:
The following XQuery fragment will add the speakername attribute as an attribute of the <p> tag:
<p>{$res/../@speakername}: {$res}</p>
becomes:
<p speakername="Roy Walter">Some text...</p>
What I want is:
<p>Roy Walter: Some text...</p>
How does MonetDB/XQuery handle this? I tried:
<p>{xs:string($res/../@speakername)}: {$res}</p>
but it errors.
-- Roy
------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ MonetDB-users mailing list MonetDB-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-users