• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

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

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic