Summary: | jsdk 1.5 xml xslt charset | ||
---|---|---|---|
Product: | Ant | Reporter: | DMoL <master_temp> |
Component: | Core tasks | Assignee: | Ant Notifications List <notifications> |
Status: | RESOLVED INVALID | ||
Severity: | major | Keywords: | XSLTBug |
Priority: | P1 | ||
Version: | 1.6.5 | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All |
Description
DMoL
2006-02-24 20:31:59 UTC
The output is in UTF-8. Actually Unicode. Try replacing "Windows-1251" with a bogus value and you will see: [xslt] Warning: encoding "aaa" not supported, using UTF-8. The resulting file is in correct Windows-1251 encoding, but valid Windows-1251 characters are encoded additionally. The output should work fine in the current form, if file size is not an issue. (In reply to comment #2) > Actually Unicode. Try replacing "Windows-1251" with a bogus value and you will > see: [xslt] Warning: encoding "aaa" not supported, using UTF-8. The resulting > file is in correct Windows-1251 encoding, but valid Windows-1251 characters are > encoded additionally. The output should work fine in the current form, if file > size is not an issue. Ok. Many thanks. But how can I (In reply to comment #2) > Actually Unicode. Try replacing "Windows-1251" with a bogus value and you will > see: [xslt] Warning: encoding "aaa" not supported, using UTF-8. The resulting > file is in correct Windows-1251 encoding, but valid Windows-1251 characters are > encoded additionally. The output should work fine in the current form, if file > size is not an issue. Thank you. But how can I reach the behavior on jdk1.4 when output is "windows-1251"? I do not think there is anything can be done in ANT. It is up to XSLT library to encode output. Why not to use UTF-8? If this problem only arises in java1.5, then it is probably due to the XSLT engine that ships with java1.5. Try adding Xalan to your ant lib directory and seeing what you can do to explicitly ask for it, if it is not picked up automatically. (In reply to comment #5) I put xalan.jar to ants lib directory, but output file didn't changed. (paremeter processor="xalan" - is deprecated in ant 1.6.5) DMoL, in reply to comment #6, try setting the factory instead, with <factory name="org.apache.xalan.processor.TransformerFactoryImpl"/> this forces xalan into action, not xsltc. Let us know what happens. (In reply to comment #7) > DMoL, in reply to comment #6, try setting the factory instead, with > <factory name="org.apache.xalan.processor.TransformerFactoryImpl"/> > this forces xalan into action, not xsltc. Let us know what happens. I have changed build.xml to this, but output still the same (incorrect, not cp-1251) <xslt in="source.xml" out="out.xml" style="style.xslt"> <factory name="org.apache.xalan.processor.TransformerFactoryImpl"/> </xslt> you don't need to specify any factory and not fiddle with ant/lib, you should install the latest version of Xalan using the endorsed standards override mechanism[1]. JDK 1.5's XSLT engine is seriously broken and you'll be happy to have it replaced. Not an Ant bug anyway. [1] http://xml.apache.org/xalan-j/faq.html#faq-N100EF |