2 Doubts

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

2 Doubts

Fabio Ebner-2
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?
i need to transform this chars:

> in &lt;
< in &gt;
& in &amp; 
" in &quot; 
' in &#39; 


tks
Reply | Threaded
Open this post in threaded view
|

Re: 2 Doubts

Jörg Schaible-2
Hi Fabio,

Fabio Ebner wrote:

> 1 - I'm using this code to generate my xml file:

[snip]

> 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

> 2 - have one easy way to transform some char during the creation of my
> file? i need to transform this chars:
>
>> in &lt;
> < in &gt;
> & 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