Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

What encoding is used by javax.xml.transform.Transformer?  RSS feed

 
Simon Reeves
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Please can you answer a couple of questions based on the code below, which transforms input
XML and XSL files into an output XSL-FO file:



inXslFile is encoded using UTF-8 - however there are no tags in file which states this.
sourceXmlFile is UTF-8 encoded and there may be a metatag at start of file indicating this.

am currently using Java 6 with intention of upgrading in the future.

1. What encoding is used when reading the xslFile?
2. What encoding is used when reading the xmlFile?
3. What encoding will be applied to the FO outfile?
4. How can I obtain the info (properties) for 1 - 3? Is there a method call?
5. How can the properties in 4 be altered - using configuration and dynamically?
6. if known - Where is there info (web site) on this that I can read - I have looked without
much success.

kind regrds,
 
Ivan Jozsef Balazs
Rancher
Posts: 999
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An XSL file is an XML file.
An XML file can declare its encoding with utf-8 being the default value (if no Byte Order Mark is given to "derail" it to utf-16).

Similarly I assume the output encoding defaults to utf-8. but your mileage may vary...

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!