File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes How to find highest element in xml file using SAX Parser? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "How to find highest element in xml file using SAX Parser?" Watch "How to find highest element in xml file using SAX Parser?" New topic
Author

How to find highest element in xml file using SAX Parser?

Rahul Noel
Ranch Hand

Joined: Jul 18, 2008
Posts: 51
Hi,
How to find highest element in xml file which contains employes details like name,salary I want to find highest salary of employee in company using SAX Parser.


Thanks in Advance.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12779
    
    5
You will need to capture the contents of the text following a <sal> element using a custom extension of org.xml.sax.helpers.DefaultHandler.

A SAX parser will call your startElement() method when the <sal> element is encountered. There will then be one or more calls to your characters() method where you need to capture the text. Next there will be an endElement() call when </sal> is encountered - at that point process the captured text to extract the numeric value.

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to find highest element in xml file using SAX Parser?