commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Heger (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CONFIGURATION-703) xml:space="preserve" does not handle blank strings properly
Date Tue, 05 Jun 2018 19:42:00 GMT

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

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

Thanks for looking this up.

However, I am still not sure how to interpret this in the context of Commons Configuration
where the focus lies in providing access to configuration data and not necessarily exact XML
processing. I don't think that it is a frequent use case to define configuration properties
with whitespace in all possible variations. So if we can comply to the specs with reasonable
effort (and do not break existing code), this is great. But IMHO it is more important to be
consistent in our own API, and we do not have to support every corner case mentioned in the
specs.

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

Mime
View raw message