From: Jonas L. <my....@gm...> - 2006-02-01 10:02:22
|
I wish to sort some items, and then group them by date (for instance 2005-12-29). Then I want to process the group further. However, the xquery below causes the following exception: org.exist.xquery.XPathException: Operation not supported =09at org.exist.xquery.value.OrderedValueSequence.toNodeSet(OrderedValueSeq= uence.java:138) =09at org.exist.xquery.LocationStep.eval(LocationStep.java:205) =09at org.exist.xquery.AbstractExpression.eval(AbstractExpression.java:56) =09at org.exist.xquery.PathExpr.eval(PathExpr.java:196) ..... What operation is not supported? If this operation is not allowed, then how can I achieve what I want? Ideas? Regards Hans ..... xquery version "1.0"; let $doc :=3D ( <root> <raw>2005-12-29T18:49:29.859+01:00</raw> <raw>2005-12-29T18:51:17.14+01:00</raw> <raw>2005-12-29T19:01:39.5+01:00</raw> <raw>2005-12-30T01:05:38.281+01:00</raw> <raw>2006-01-02T00:54:57.968+01:00</raw> <raw>2006-01-13T00:26:01.906+01:00</raw> </root>) let $sorted :=3D (for $item in $doc/* order by $item/entry/raw return $item) return (<page>{ for $subset in distinct-values($sorted/raw/substring(text(), 1, 10= )) let $set :=3D $sorted/raw[substring(text(), 1, 10) =3D $subset] order by $subset descending =09 return <sequence><s>{$subset}</s>{$set}</sequ= ence> }</page>) |