In case of transformation - when we use StAXResult in the output
indentation is lost , newline characters are not taken care of ..
but this works if we use StreamResult instead
In case of StreamResult , behaviour depends on what we set through
transformer.setOutputProperty() - whether 'yes' or 'no' !
but with StAXResult there is no change in behaviour according to
what we set using transformer.setOutputProperty()
------------------- cities101.out with StAXResult -------------------------------------
<?xml version="1.0" encoding="UTF-8"?><countries><country name="France"><city>Paris</city><city>Nice</city><city>Lyon</city></country><country name="Italia"><city>Roma</city><city>Milano</city><city>Firenze</city><city>Napoli</city></country><country name="Espana"><city>Madrid</city><city>Barcelona</city></country></countries>
--------------------------- cities108.out with StreamResult ---------------------------
<?xml version="1.0" encoding="UTF-8"?>
<countries>
<country name="France">
<city>Paris</city>
<city>Nice</city>
<city>Lyon</city>
</country>
<country name="Italia">
<city>Roma</city>
<city>Milano</city>
<city>Firenze</city>
<city>Napoli</city>
</country>
<country name="Espana">
<city>Madrid</city>
<city>Barcelona</city>
</country>
</countries>
------------------------------------------------------------------------------------------
Attached testcase - Test3.java will show this behaviour
indentation is lost , newline characters are not taken care of ..
but this works if we use StreamResult instead
In case of StreamResult , behaviour depends on what we set through
transformer.setOutputProperty() - whether 'yes' or 'no' !
but with StAXResult there is no change in behaviour according to
what we set using transformer.setOutputProperty()
------------------- cities101.out with StAXResult -------------------------------------
<?xml version="1.0" encoding="UTF-8"?><countries><country name="France"><city>Paris</city><city>Nice</city><city>Lyon</city></country><country name="Italia"><city>Roma</city><city>Milano</city><city>Firenze</city><city>Napoli</city></country><country name="Espana"><city>Madrid</city><city>Barcelona</city></country></countries>
--------------------------- cities108.out with StreamResult ---------------------------
<?xml version="1.0" encoding="UTF-8"?>
<countries>
<country name="France">
<city>Paris</city>
<city>Nice</city>
<city>Lyon</city>
</country>
<country name="Italia">
<city>Roma</city>
<city>Milano</city>
<city>Firenze</city>
<city>Napoli</city>
</country>
<country name="Espana">
<city>Madrid</city>
<city>Barcelona</city>
</country>
</countries>
------------------------------------------------------------------------------------------
Attached testcase - Test3.java will show this behaviour