Basic StAX Parsing Using Woodstox

Overview Woodstox provides excellent support for StAX (Streaming API for XML) parsing. Streaming API is used to parse large XML documents in a performance efficient manner. StAX compliant parsers do not load the entire XML document in memory but use a ‘Pull Model’ to load sections of document and parse it. Woodstox is compliant with … Read more

Woodstox : Steps In Loading of Woodstox Classes

Overview Woodstox classes are loaded using javax.xml.stream.XMLInputFactory.newInstance() . The steps involved in loading of Woodstox classes is explained below: javax.xml.stream.XMLInputFactory.newInstance() is called by client code The file ‘META-INF/services/javax.xml.stream.XMLInputFactory’ is searched in the current classpath As the current classpath contains woodstox-core-asl-4.2.0.jar, the file ‘META-INF/services/javax.xml.stream.XMLInputFactory’ is found as shown below The contents of ‘META-INF/services/javax.xml.stream.XMLInputFactory’ (as shown below) … Read more

Java XML: Woodstox Introduction

Overview Woodstox is a very powerful toolkit for XML processing.Its main features are as follows: Namespace aware StAX (Streaming API for XML) compliant (JSR-173) processor Support for DTD, RelaxNG and W3C Validations Support for both XML parsing and XML creation SAX (Simple API for XML) parsing and validation High performance processor with excellant error handling … Read more

Java API for XML (JAXP) – XPath

XPath and JAXP XPath is a language for querying XML Documents. Using a certain syntax XPath can retrieve specific node or list of nodes from the XML Document. This tutorial does not explain XPath syntax but shows how to use JAXP to implement XPath querying. The Steps for XPath querying are: Obtain the XPath class … Read more

Java API for XML (JAXP) – XSLT Transformation

XSLT Introduction XSLT is the language for transforming XML documents into other documents such as HTML or other XML documents. It is part of the XSL or XML Schema language. The input to the transformation is a source tree and the output is the result tree. It uses predefined templates to match parts of the … Read more

Java API for XML (JAXP) – Validation

Validating XML using DTD or XSD An XML document is considered ‘well-formed’ if it follows the normal rules of XML. i.e. all tags are closed properly etc. On the other hand, an XML is considered valid if it follows the rules specified in the DTD or XSD. In the example below we look at validating … Read more

Java API for XML (JAXP) – StAX

StAX API in JAXP StAX stands for Streaming API for XML. In the earlier tutorials we have seen DOM (Document Object Model) where a Document tree is created out of the xml and the entire document tree is stored in memory. We have also see the SAX (Simple API for XML) API wherein the parser … Read more

Java API for XML (JAXP) – SAX

What is SAX SAX stands for Simple API for XML. It is an event driven method of accessing elements of an XML document. The elements are accessed serially. The API fire events for each type of data that it finds. The user provides a Handler that can handle the various kinds of events thrown by … Read more

Java API for XML (JAXP) – DOM

What is DOM DOM is an Object representation of an XML, HTML or XHTML document. In this tutorial we will be dealing with only XML. DOM represents the XML as a Document tree. JAXP provides API for DOM implementation in Java. It also provides parsing interface which can be used to plugin different parsers (JAXP … Read more

Java API for XML (JAXP) – Introduction

What is Java API for XML (JAXP) JAXP is the Java reference implementation for parsing, transforming, validating and querying XML documents. In other words using the JAXP API you can Parse an XML document using the Document Object Model (DOM) representation of the XML document – JAXP provides the classes that form the DOM Model. … Read more