You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Java Xerces Rule <xe...@bilbao.com> on 2001/11/21 17:34:01 UTC
How to sort alphabetically
Hi all!
I'm parsing an XML document:
------//-----------
<table>
<pupil>
<name></name>
<surname></surname>
</pupil>
...
</table>
----------//---------
I would like to display Pupils' data, but sorting them
alphabetically by the surname.
I'm trying it by using:
-----------//----------------
NodeList PupilList = root.getElementsByTagName("pupil");
int NumberPupils = PupilList.getLength();
for (int i=0; i<NumberPupils; i++) {
Node PupilAlone = PupilList.item(i);
traversePupil(PupilAlone);
...
----------//--------------
But they are sorted in the same way they are in the XML
document.
Any suggestion? Thank you very much.
_______________________________________________________________________
Gana un antivirus abriendo tu cuenta de correo gratis en HispaVista.
http://www.hispavista.com/altacorreo/
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org