Saturday, February 27, 2010

XML Processing

1 Introduction to XML Processing

 
XML Processing can be done in either of the following ways:-

1) Parsing
     a. Involves scanning the document in the following ways:-
         i. Push approach (Example for push parsers:- SAX )
         ii. Pull approach (Example for pull parsers:- STaX)

2) Binding
      a. Involves the following steps
          i. Binds XML to Java objects (Generating java classes from XML Schema),
          ii. Marshalling and Unmarshalling (Unmarshalling means creating a tree of content [java] objects from the XML document [not schema]. Marshalling means creating the XML document from the java objects. Both uses parsing techniques)

3) Transformation
    a. Transformation engine and filter

 
2 Why Binding?

 
   We are primarily interested in binding, because of the fact that XML binding allows Java developers to access and process XML data without having to know XML or XML processing. For example, there's no need to create or use a SAX parser or write callback methods while going with binding tools such as JAXB or JiBX.

 
3 Binding tools

 
   Some of the binding tools available in the market are:-

 
  • Castor (open source)
  • JAXB (open source)
  • JiBX (open source)
  • XML Spy (commercial)
  • Jakarta Digester (open source)

 
A listing of these can be found @ http://www.xmldatabinding.org/

 

1 comments:

Anonymous said...

VTD-XML is another popular XML parsing model that you might want to investigate

http://java.dzone.com/articles/introduction-vtd-xml