JAXP apparently only works with well-formed XML. You will need to convert the HTML to XHTML before exposing it to standard JAXP parsers.
TransformerFactory tf = TransformerFactory.newInstance();
StreamSource xslt = new StreamSource(
"src/blog/jaxbsource/xslt/stylesheet.xsl");
Transformer transformer = tf.newTransformer(xslt);
JAXBContext jc = JAXBContext.newInstance(Library.class);
JAXBSource source = new JAXBSource(jc, catalog);
StreamResult result = new StreamResult(System.out);
transformer.transform(source, result);
URL: [ https://dzone.com/articles/using-jaxb-xslt-produce-html†[1]
source
share