|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Apache Xalan 2.2 for Java problems with Unicode
I'm trying to transform an XML file (encoded in UTF-8) using Apache's Xalan
2.2 package for Java. It gives me the following exception:
javax.xml.transform.TransformerException: An invalid XML character (Unicode:
0xfc) was found in the element content of the document.
Has anyone experienced this? Unicode 0xFC is a lowercase 'u' with an umlaut
(ü). It works fine when I remove those characters. Is there a way to set
the encoding for the Transformer object in Java or something like that?
Here is the relevant Java code where intermediateFile is the XML file and
returnFile is a blank File object to which the HTML is written:
System.out.println("Beginning XSL transformation of page
#"+pageID+".");
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer(new
StreamSource("D:\\tempDirectory\\story.xsl"));
StreamSource streamSource = new StreamSource(intermediateFile);
StreamResult streamResult = new StreamResult(new
FileOutputStream(returnFile));
transformer.transform(streamSource, streamResult);
streamResult.getOutputStream().close();
System.out.println("XSL transformation of page #"+pageID+"
completed.");
Thanks in advance,
Jamie
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








