I have a collection of files describing magazines content
<magazine>
<issue.number>22</issue.number>
<article>
<title>first article</title>
<subject>James</James>
</article>
<article>
<title>second article</title>
<subject>James</subject>
</article>
</magazine>
I want to output a list of articles in a format of <issue.number>, <title>.
So I created an XQuery:
for $x in /magazine
return concat($x/issue.number/text(),',',$x//title/text())
This results in an error, which I think is caused because the <issue.number> value is being returned twice. In eXist DB I get this:
The actual cardinality for parameter 1 does not match the cardinality declared in the function's signature: concat($atomizable-values as xdt:anyAtomicType?, ...) xs:string?. Expected cardinality: zero or one, got 2.
So if I can't use concat() what can I use?
Forand a missing variable name), please make sure to copy-paste code, not type it again to prevent such mistakes. - Jens Erat