JAXBException: Implementation of JAXB-API has not been found on module path or classpath

This article shows how to solve the popular JAXB exception Implementation of JAXB-API has not been found on module path or classpath. Table of contents 1. JAXBException: Implementation of JAXB-API has not been found 2. We need a JAXB Implementation 3. JAXB Implementation – Jakarta XML Binding 4. JAXB Implementation – EclipseLink MOXy 4.1 Implementation …

Read more

Java DOM Parser XML and XSLT examples

With XSLT(Extensible Stylesheet Language Transformations), we can transform XML documents into other formats such as HTML. Table of contents 1. DOM Parser and Transformer 2. DOM example: XML + XSLT = HTML format 3. Download Source Code 4. References P.S Tested with Java 11 1. DOM Parser and Transformer We can use the TransformerFactory to …

Read more

Python – Read XML file (DOM Example)

In this example, we will show you how to read an XML file and print out its values, via Python xml.dom.minidom. 1. XML File A simple XML file, later parse it with Python minidom. staff.xml <?xml version="1.0"?> <company> <name>Mkyong Enterprise</name> <staff id="1001"> <nickname>mkyong</nickname> <salary>100,000</salary> </staff> <staff id="1002"> <nickname>yflow</nickname> <salary>200,000</salary> </staff> <staff id="1003"> <nickname>alex</nickname> <salary>20,000</salary> </staff> …

Read more

JAXB hello world example

Jakarta XML Binding (JAXB; formerly Java Architecture for XML Binding) is an XML binding framework to convert Java objects to and from XML. XML Marshalling – Convert Java objects into XML. XML Unmarshalling – Convert XML back into Java Objects. Note This article will focus on Java 11, JAXB 3 and EclipseLink MOXy JAXB RI. …

Read more

How to read XML file in Java – (JDOM Parser)

JDOM is open-source Java-based XML parser framework built on top of DOM and SAX, also a document object model(DOM) in-memory representation of an XML document. JDOM makes navigating XML documents easier by providing more straightforward APIs and a standard Java-based collection interface. If you don’t mind downloading a small library to parse an XML file, …

Read more

SAX Error – Content is not allowed in prolog

We use SAX parser to parse an XML file, and hist the following error message: Terminal org.xml.sax.SAXParseException; systemId: ../src/main/resources/staff.xml; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog. In short, invalid text or BOM before the XML declaration or different encoding will cause the SAX Error – Content is not allowed in prolog. 1. …

Read more