aspose 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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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: 12675
    
    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


Java Resources at www.wbrogden.com
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to find highest element in xml file using SAX Parser?
 
Similar Threads
Beginner In XML! Need Help
How to get XML file name ?
XML file parsing in Java using SAX
SAX praser passing element's attribute value dynamically
Remove Element from XML