From: Wolfgang M. <sb...@we...> - 2004-05-11 16:42:28
|
> Am I understanding xquery incorrectly or is this a bug? > I should note that if I do: > > <div>{collection("/db/pageforum/data/")/forums/@nextid cast as > xs:string}</div> > > then it gives me what I explect: > > <div>20</div> No, it isn't a bug. If the enclosed expression evaluates to an attribute, it is added to the surrounding element. I haven't found this in the XQuery spec itself, but it becomes clear if you look at the XQuery use cases. > Why should I have to cast the attribute? Also, how can I do this same sort > of case within xupdate? I originally had the problem there, so I was > trying to debug it in xquery. You can define a variable in xupdate: <xu:variable name="id" select="..."/> then reference it with <xu:value-of select="$id"/> Wolfgang |