I have 6 XML files containing the following tag
the first XML file is
<root>
<firstName> Smith</firstName>
<lastname>Joe</lastname>
<Age>60</age>
</root>
the second is
<root>
<firstName> John</firstName>
<lastname>Andrew</lastname>
<Age>55</age>
</root>
and so on
the required is to print the firstname,lastname,age and I have done that in agood way.However, I need also to
print ages sorted by age
so first should be 55 then 60. I could not do that by sax it was really
The only possible reason for using SAX is because you don’t want to allocate memory to store the whole document. If you’re sorting, then SAX gives you no benefits – you’re using a very low-level interface to no purpose. If you want to sort the data then by far the best solution is to use a high-level XML processing language such as XSLT or XQuery.