Fabio Ebner
2015-01-02 12:30:23 UTC
1 - I'm using this code to generate my xml file:
XStream stream = new XStream(new DomDriver("ISO-8859-1", new
XmlFriendlyNameCoder("_-", "_")));
stream.processAnnotations(Notas.class);
stream.aliasSystemAttribute(null, "class");
FileOutputStream outputStream;
try {
String nmArquivo =
iconfiguracao.getConfiguracao().getNmDiretorioCaixaSaida() + File.separator
+ nmArquivoRemessa;
outputStream = new FileOutputStream(nmArquivo);
stream.toXML(notas, outputStream);
outputStream.close();
} catch ( IOException e) {
e.printStackTrace();
}
but i want to know if its possible to i add the <?xml version="1.0"
encoding="ISO-8859-1"?>
at beginning of my file? how?
2 - have one easy way to transform some char during the creation of my file?
& in &
" in "
' in '
tks
XStream stream = new XStream(new DomDriver("ISO-8859-1", new
XmlFriendlyNameCoder("_-", "_")));
stream.processAnnotations(Notas.class);
stream.aliasSystemAttribute(null, "class");
FileOutputStream outputStream;
try {
String nmArquivo =
iconfiguracao.getConfiguracao().getNmDiretorioCaixaSaida() + File.separator
+ nmArquivoRemessa;
outputStream = new FileOutputStream(nmArquivo);
stream.toXML(notas, outputStream);
outputStream.close();
} catch ( IOException e) {
e.printStackTrace();
}
but i want to know if its possible to i add the <?xml version="1.0"
encoding="ISO-8859-1"?>
at beginning of my file? how?
2 - have one easy way to transform some char during the creation of my file?
& in &
" in "
' in '
tks