Closed
Description
Hello,
just finally migrated from jdom 1.1 to jdom 2.0.6.
However I have an example where org.jdom2.Element.getContentSize() returns another result than the Version 1.1 counterpart did, which breaks some dependent code.
Example:
Document doc = null;
try {
File f = new File("C:\\...\\RPTXXMLTEST.xml");
// In Version 1.1 this was new SAXBuilder(false)
doc = new SAXBuilder( XMLReaders.NONVALIDATING ).build( f );
Element rootElement = doc.getRootElement();
System.out.println("Content Size is " + rootElement.getContentSize());
} catch( Exception e ) {
e.printStackTrace();
}
Corresponding RPTXXMLTEST.xml is getting attached.
RPTXXMLTEST.zip
(Content as it's not much:)
<?xml version="1.0" encoding="UTF-8"?>
<beanparameter1><![CDATA[TEST]]></beanparameter1>
In Version 1.1 the Result was "Content Size is 1" - in 2.0.6 it's "Content Size is 2".
As it is a single element I would await a contentSize of "1".
Is the new behaviour expected and if yes, then why?
Thanks for your efforts.