We are moved to new domain
Click -> www.ehowtonow.com
Saturday, 8 February 2014

Java StAX Introduction

In this tutorial we are going to see the Java Streaming API for XML (StAX).

The StAX is a streaming Java technology-based, event-driven, pull-parsing API for reading and writing XML documents. StAX enables you to create bidrectional XML parsers that are fast, relatively easy to program, and have a light memory footprint.

The Streaming API for XML (StAX) is the latest standard for processing XML in the Java language. As a stream-oriented approach, it often proves a better alternative to other methods, such as DOM and SAX, both in terms of performance and usability.

The StAX API is just like SAX API, but the main difference between StAX and SAX API are

  1. SAX is a “push” API. StAX is a “pull” API.
  2. SAX can only do XML reading. StAX can do both XML reading and writing.

The Pull Parsing :

In pull parsing model application can take the control over parsing XML document by pulling the event from the parser. The core StAX API is divided into two categories.

  1. Cursor API
  2. Event Iterator  API

We can use any one of API for parsing XML documents.

We will see the details of PULL and PUSH API , Cursor and Event Iterator API’s, StAX with other API’s, Read, write XML using StAX API in upcoming tutorial.

Shop and help us

Flipkart Offer Snapdeal offer Amazon.in offer Amazon.com offer
  • Blogger Comments
  • Facebook Comments
  • Disqus Comments

0 comments:

Post a Comment

Item Reviewed: Java StAX Introduction Rating: 5 Reviewed By: eHowToNow