• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Which API for SAX

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a very large (several hundred MB) xml file that I need to transform in various ways. Due to the size, I will use a SAX implementation. Being new to the java xml related API's, there appear to be a lot of xml api's provided by Sun, as well as apache,...etc.
For those of you who've done SAX parsing in java, which libraries do you recommend?
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Being new to the java xml related API's, there appear to be a lot of xml api's provided by Sun, as well as apache,...etc.


Actually, there's only one "standard" XML parsing API provided by Sun, namely JAXP. In practice, you write your code against JAXP APIs (javax.xml.parsers.*, org.xml.sax.*, and org.w3c.dom.*) and configure the JVM to use some implementation of those APIs: Apache Crimson (which comes with JDK1.4) and Apache Xerces (most people/products out there use Xerces, which is Crimson's successor).

For those of you who've done SAX parsing in java, which libraries do you recommend?

Based on what I said above, I'd recommend the following:
  • Use the standard JAXP API unless you absolutely need some feature only available through product-specific APIs
  • Use the Crimson parser implementation if you can rely on JDK1.4 being used (the easiest way) and unless you need some features only available in Xerces or some other implementation (schema validation comes to mind)

  •  
    I was born with webbed fish toes. This tiny ad is my only friend:
    a bit of art, as a gift, the permaculture playing cards
    https://gardener-gift.com
    reply
      Bookmark Topic Watch Topic
    • New Topic