[ad_1]
I have this XML file:
<collection>
<journal name = "La Repubblica" issn = "1">
<volume number = "1" date = "12/04/2022">
<article doi = "AB23">
<author orcid = "XY21">
<firstname>Marco</firstname>
<surname>Rossi</surname>
<affiliation>Affi</affiliation>
</author>
<author orcid = "XYZ">
<firstname>Simone</firstname>
<surname>Mambo</surname>
</author>
<title>Stop alle mascherine</title>
<abstract>Da maggio si può dire basta alle mascherine</abstract>
<keyword>COVID</keyword>
</article>
<article doi = "AB60">
<author orcid = "XY21">
<firstname>Marco</firstname>
<surname>Rossi</surname>
<affiliation>Affi</affiliation>
</author>
<title>Un altro titolo</title>
<abstract>Un altro abstract</abstract>
<keyword>Titolo</keyword>
</article>
</volume>
</journal>
</collection>
and this xQuery script:
<publications>
{
for $au in distinct-values(doc("collection.xml")//author)
return
<author orcid = "{ $au/@orcid }">
<firstname>{ $au/firstname/text() }</firstname>
</author>
}
</publications>
Unfortunately this is giving me:
XPTY0019 The required item type of the first operand of “https://stackoverflow.com/” is node(), but the supplied
expression {$ar} has item type xs:anyAtomicType
[ad_2]