_xql, _cursor and multiple elements

Dear collegues

I will be pleased on any feedback about the next problem.

  1. when we perform a sorted query, via a cursor, using _xql, then we get every docs in the doctype instead the subset asked. The query is the next one:

http://i_merw2k/tamino/CCPXIX/estelac?_xql(1,10)=STLIbermarcData sortby (STLValidation[1]/STLValidationName asc)

  1. The key of the problem, seems to be in the use of the selection of first ocurrence in STLValidation[1]. Of course STLValidation is a multiple element. In the other hand, none of the stored documents in the database, has more than one ocurrence of the element STLValidation. Performing the same query, without restriction about STLValidation ocurrence, everything seems to work OK, getting back from Tamino, just the subset selected, instead the complete doctype content. The query is the following:

http://i_merw2k/tamino/CCPXIX/estelac?_xql(1,10)=STLIbermarcData sortby (STLValidation/STLValidationName asc)

  1. We tried also, the _cursor command, with the following aspect, and it delivers the same answer as the second query:

http://i_merw2k/tamino/CCPXIX/estelac?_cursor=open&_xql=STLIbermarcData sortby (STLValidation[1]/STLValidationName asc)&_position=1&_quantity=10

Questions

The _xql(a,b) cursoring has some known bugs. Therefore the new cursoring using the _cursor keyword was implemented. The old cursoring was kept only for backward compatibility with existing applications; it will not be adapted to new functionality.

sortall is newer functionality, and large parts of sortby were also re-implemented to fix some problems where sortby was ignored but should actually have sorted something. This new functionality is not supported by _xql(a,b), only those cases that worked correctly with sortby will work still work with _xql(a,b).

So it is recommended to not use _xql(a,b) any more, but replace it by using _cursor with _xql.

With _xquery, a positional filter could be used, when you are interested in one section of the result only:

_xquery=(input()/STLIbermarcData 
         sort by (STLValidation[1]/STLValidationName ascending) 
        )[position() <= 10]

Dear Gunther

Thanks for your repply. Then we will translate queries with _xql(a,b) to _cursor.

Best regards
Ignacio