Discussion:
[xstream-user] 2 Doubts
Fabio Ebner
2015-01-02 12:30:23 UTC
Permalink
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 &amp;
" in &quot;
' in &#39;


tks
Jörg Schaible
2015-01-02 15:34:22 UTC
Permalink
Hi Fabio,
[snip]
Post by Fabio Ebner
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?
This is documented:
http://xstream.codehaus.org/faq.html#XML_write_XML_declaration
Post by Fabio Ebner
2 - have one easy way to transform some char during the creation of my
& in &amp;
" in &quot;
' in &#39;
This is done automatically ... ?

Cheers,
Jörg


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Continue reading on narkive:
Loading...