[ 
https://issues.apache.org/jira/browse/CONFIGURATION-703?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16491674#comment-16491674
 ] 

Oliver Heger commented on CONFIGURATION-703:
--------------------------------------------

Thanks for this report.

>From the unit tests of {{XMLConfiguration}} I expect that the handling of the 
>of the _xml:space_ attribute should work in principle. Your case is somewhat 
>special as it applies this attribute to the rool element and does not have any 
>other elements in the XML document. So the problem could be specific to this 
>constellation.

Did you test with other documents containing multiple elements? (Just to rule 
out that there is a general problem.)

After applying your fix, do the unit tests still pass?

> 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)

Reply via email to