This post demonstrates how to modify some parts of the XML content in Java using XSLT. The example herein is rather straight-forward but will provide us a basic working codes before going further to learn the more advanced stuff.
When a XML uses namespaces, they need to be declared and used in the .xsl file so that the javax.xml.transform.Transformer knows how to deal with various elements in the XML. This post demonstrates how to deal with namespaces when performing transformation from or on XMLs.
This post demonstrates how to write XML files using DOM in Java.
This post demonstrates how to read XML files using DOM Parser which parses and loads the entire XML into memory in a Tree structure which makes it very easy to traverse and manipulate elements.
This post demonstrates how to perform pre- and post-processing with Unmarshaller.Listener. For instance you may want to compare the contents of an object before and after you unmarshal an XML. Another use-case is when you may need to store unmarshalled values to some list not mapped to any XML element. This is achieved by creating a class that extends Unmarshaller.Listener and overriding two (2) methods – beforeUnmarshal and afterUnmarshal.
This post demonstrates how to render an XML to a file from a given XML template using Spring Boot and Thymeleaf.
This post demonstrates how to convert a file to InputStreamReader.
The classes XMLEncoder and XMLDecoder allows you to convert JavaBean objects to XML and back, respectively. Note, that they are specifically designed for JavaBeans specification. Using objects whose classes do not
Here, we’ll be using XMLUnit from www.xmlunit.org in a Maven project.
This articles demonstrates how to use Apache XML-RPC in Java command-line applications. We will create programs both for XML-RPC server and client.