Hi group,

Is possible ignore whitespace using xstream library

For example: I have this xml

<?xml version="1.0" encoding="ISO-8859-1"?><resultset>
        <inspecaofitossanitariaimport action="insert">
            <cdColetor><![CDATA[111]]></cdColetor>
           <dataAmostragem><![CDATA[19/01/2012]]></dataAmostragem>
           <id><![CDATA[33154434]]></id>
           <idUPNivel3><![CDATA[3808304280861701658]]></idUPNivel3>
          <rowVersion><![CDATA[1]]></rowVersion>
       </inspecaofitossanitariaimport>
</resultset>



Using this converter source

XStream stream = getInstanceXStream();
stream.processAnnotations(
new
Class[]{InspecaoFitossanitariaCollection.class,InspecaoFitossanitaria.class}
);
stream.setMode(XStream.NO_REFERENCES);
stream.autodetectAnnotations(true);
return stream.toXML(value);

would be possible to generate an xml ignoring whitespaces from xml
identation

For example getting this result:

<?xml version="1.0" encoding="ISO-8859-1"?><resultset><
inspecaofitossanitariaimport action="insert"><cdColetor><![
CDATA[111]]></cdColetor><dataAmostragem><![CDA
TA[19/01/2012]]></dataAmostragem><id><![CDATA[33154434]]></id><idUPNivel3><!
[CDATA[3808304280861701658]]></idUPNivel3><rowVersion><![CDATA[1]]></
rowVersion></inspecaofitossanitariaimport></resultset>

Thanks, =)

Reply via email to