Details
-
Type: Bug
-
Status: Open
-
Priority: Minor
-
Resolution: Unresolved
-
Affects Version/s: 1.4.4
-
Fix Version/s: None
-
Component/s: Core
-
Labels:None
-
JDK version and platform:All
Description
As discussed with Jörg on the mailing list. Although the Javadoc and FAQ say that toXML will give pretty-printed XML 'snippets' (no header), this only occurs if not using the StaxDriver. There are 3 possible solution types:
a) Update Javadoc and FAQ to make clear that the header presence and pretty-printing is driver-dependent (and put info. about the header in the Javadoc).
b) Provide non-backwards-compatibility-breaking code to allow an 'XStream contract consistent' version of the StaX driver to be used (e.g., a separate driver class StaxContractConsistentDriver).
c) Fix the API 'properly' so that XStream always returns pretty-printed snippets, irrespective of the driver used. This might need to be a major release change since it could break code for users assuming the header existence when using StaxDriver.