[ https://issues.apache.org/jira/browse/CONFIGURATION-703?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16498902#comment-16498902 ]
Pascal Essiembre commented on CONFIGURATION-703: ------------------------------------------------ Some of the tests fail when I do not consider child attributes. The reason seems to be that some tests expect {{null}} while others expect an empty string when we are not preserving spaces and there is no content. Shouldn't it be consistent? If so, I have a fix, but for it to work we would have to settle on one or the other and modify a few tests accordingly. > xml:space="preserve" does not handle blank strings properly > ----------------------------------------------------------- > > Key: CONFIGURATION-703 > URL: https://issues.apache.org/jira/browse/CONFIGURATION-703 > Project: Commons Configuration > Issue Type: Bug > Affects Versions: 2.2 > Reporter: Pascal Essiembre > Priority: Major > > When using XMLConfiguration 2, tags containing only white spaces are not > handled properly when xml:space="preserve" is set. 'null' is returned > instead of the actual spaces. To reproduce: > > {code:java} > XMLConfiguration xml = new BasicConfigurationBuilder<>( > XMLConfiguration.class).configure( > new Parameters().xml()).getConfiguration(); > FileHandler fh = new FileHandler(xml); > fh.load(new StringReader("<test xml:space=\"preserve\"> </test>")); > System.out.println("TEST: '" + xml.getString("") + "'"); > // Outputs -> TEST: 'null' > // Should be -> TEST: ' ' > {code} > > > > -- This message was sent by Atlassian JIRA (v7.6.3#76005)