Skip to content

index:index-abfragen() creates a cardinality error for sorting by date

Created by: GVogeler

<cei:issued xmlns:cei="http://www.monasterium.net/NS/cei">
    <cei:date value="9049999">904</cei:date>
    <cei:placeName>Salerni</cei:placeName>
    <cei:dateRange from="99999999" to="99999999"/>
</cei:issued

results in the error "The actual cardinality for parameter 1 does not match the cardinality declared in the function's signature: number($arg as xs:anyAtomicType?) xs:double. Expected cardinality: zero or one, got 2. [at line 161, column 26, source: /db/XRX.live/mom/app/index/index.xqm] In function: index:index-abfrage(item()*) " This is due to the fact that in this case $date contains two values, when https://github.com/icaruseu/mom-ca/blob/master/my/XRX/src/mom/app/index/index.xqm#L80 is evaluated.