Sorting elements by the value of @n
Posted: Mon Jan 09, 2023 1:44 pm
We are trying to develop an action in Java to sort elements by the value of their attribute n. Is there a simple way to do this?
The xml structure is as follows. Here the <msItemStruct> elements have a n attribute, but they are not sorted correctly. We would like to find a simple way to sort the elements according to the value of n.
Thanks in advance.
Michela
The xml structure is as follows. Here the <msItemStruct> elements have a n attribute, but they are not sorted correctly. We would like to find a simple way to sort the elements according to the value of n.
Code: Select all
<msItemStruct xml:id="handschriftID-msItemStruct-medieval">
<msItemStruct n="2">
<title xml:lang="lat">Decretum</title>
</msItemStruct>
<msItemStruct n="3">
<title xml:lang="lat">Brief Isidors von Sevilla an Bischof Massona von Mérida</title>
</msItemStruct>
<msItemStruct n="1">
<title xml:lang="lat">Ordo de celebrando concilio</title>
</msItemStruct>
</msItemStruct>
Michela