i use following code to transform content of xml file (fileName) to html to show it in browser using stylesheet (xsltFile)
StringWriter sw = new StringWriter();
// 1. Instantiate a TransformerFactory.
TransformerFactory tFactory = TransformerFactory.newInstance();
// 2. Use the TransformerFactory to process the stylesheet Source and generate a Transformer.
Transformer transformer = tFactory.newTransformer(new StreamSource(xsltFile));
SAXBuilder builder = new SAXBuilder();
Document doc = builder.build(new File(fileName);
JDOMSource source = new JDOMSource(doc);
transformer.transform(source, new StreamResult(sw));
and it works fine, except in case when in xml file occurs character 0x1e. and i got following exception
An invalid XML character (Unicode: 0x1e) was found in the element content of the document.
i tried with different builders, parsers... but allways is same exception.
what do i do wrong?
thanks in advance