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:30:52 UTC

How to order 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 ordering 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 ordered 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