XSLT, TransformException and encoding
This logic transforms XML data using an XSLT stylesheet:
initTransformer.transform(new StreamSource(src), new StreamResult(target)); It is generating a TransformerException when parsed but only when the data contains a % sign followed by any number:
java.lang.Exception: javax.xml.transform.TransformerException: org.xml
.sax.SAXParseException: An invalid XML character (Unicode: 0x10) was found in the CDATA section.
I don't believe the % sign is typically encoded like ><&' are so I'm not sure encoding will help. What am I missing here?
That isn't a "%" character, it's something else. Something that is not valid in an XML file. Maybe it looks like "%" in your text editor but it isn't. So send the file back to wherever it came from and ask them to send you valid XML. It's not your responsibility to clean up other people's messes, at least not in the XML world.