Transform xml to html using xslt in java
Get via App Store Read this post in our app!
How to convert XML to HTML using XSLT in Java
I want to convert XML file into HTML file with help of XSLT. But I am getting an error i.e.
javax.xml.transform.TransformerException: javax.xml.transform.TransformerException: com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: Invalid byte 1 of 1-byte UTF-8 sequence.
To me, this looks like an encoding problem. Try to ensure that the files are encoded correctly in all cases.
For example, add encoding="UTF-8" to your XML and XSLT file. But note that this is only a declaration - it does not change the characters themselves.
Also, you could copy your XML content into a simple editor and save it explicitly as UTF-8. For instance, if you are using windows, copy the content into notepad, hit "Save as. ". In the file dialog, you can choose "UTF-8" from a drop-down.
Your code works fine. In the question stylesheet node was not closed.
Also check the xsl path properly or test by