Parsing XML with Java

Here are some notes on parsing XML file with java to extract information Simple Example Assume we have an XML file and we want to extract specific attributes. A sample file could be: With XMLStreamReder Here is the code to quickly scan the XML file and get the values for Read more…

XSL-T to HTML

This article explain how to use XSL Transformation to build an XHTML document. XSL Transform for build XHTML Assume we want transform following XML document An XSL Transform take on XML input and will produce output in several  formats. To produce XHTML output we must define the correct output format Read more…

Java XML processing with dom4j

XML DOM Parsing XPath Navigation Use XPath expression to navigate the document tree. Processing a single node To process multiple results, we need to use a List Document Creation You can create a docuemnt from scratch by using the DocumentHelper#createDocuemnt(). Adding nodes and attributes is easy and intuitive. Writing document to Read more…

ANT Intro

ANT (Another Neat Tool) ANT is a tool for automating software build processes, implemented in Java, and best suited to build Java projects. Ant uses an XML file to describe the build process and its dependencies. Ant is an Apache project, it is open source software, released under the Apache Read more…

Java XSL Transform

This is a snippet of code to show how to perform an XSL transformation with Java Below you can see how to XSL Transform using File, StreamSource and StreamResult. And there it is an example of XSL Transform using StringReader and StringWriter. Source code is available on my Git repository: Read more…