Sunday, March 03, 2013

XML Programming in Java

Here is a list of tutorials that I think are useful for XML programming in Java.

 - http://xjaphx.wordpress.com/2011/12/24/android-xml-adventure-parsing-xml-using-xpath/
 - http://www.ibm.com/developerworks/library/x-javaxpathapi/index.html
 - http://www.ibm.com/developerworks/java/library/j-jdom/
 - http://docs.oracle.com/javase/tutorial/jaxp/dom/readingXML.html

Basically, there are two XML programming styles in general. It is DOM-based and SAX-based. Simply speaking, DOM-based XML programming is a style to construct a whole XML tree first and to navigate it for one's own sake. SAX-based XML programming is a stream-based style to construct only the part of the whole XML tree on demand. It never attempts to store the whole XML tree in the memory, which may consume quite big resources depending on the size of XML documents.

The SAX-based XML programming can be classified into two sub-styles. One sub-style is driven by the XML parser that will call user's registered functions on receiving the relevant XML elements. It is called SAX & Push style. That is, the XML parser calls user functions. The other sub-style is driven by user functions that will call the XML parser in sequence. It is called SAX & Pull style.

The notion of XML programming seems to be more important because programmers need to know it in developing mobile phone software, as well as for web systems.

( I'll try to update this page more later. )


No comments: