I have a list of /bibl entries, each with a /date @when="YEAR" child element. I am trying to output only the first instance of each year.
`<listBibl>
<bibl>
<date when="1746"/>
</bibl>
<bibl>
<date when="1746"/>
</bibl>
<bibl>
<date when="1746"/>
</bibl>
<bibl>
<date when="1746"/>
</bibl>
<bibl>
<date when="1747"/>
</bibl>
<bibl>
<date when="1747"/>
</bibl>
<bibl>
<date when="1747"/>
</bibl>
<bibl>
<date when="1754"/>
</bibl>
<bibl>
<date when="1754"/>
</bibl>
</listBibl>
I have written an expression that finds this: for $d in /date/@when return (/date[@when=$d])[1]
But this won’t work in the programme (teipublisher) I am using to output the attribute value. Does anybody have any suggestions about how I might do this differently.
By using BaseX, v.9.6.4
XQuery
Output XML