commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pascal Essiembre (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CONFIGURATION-703) xml:space="preserve" does not handle blank strings properly
Date Sat, 26 May 2018 23:56:00 GMT

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

Pascal Essiembre commented on CONFIGURATION-703:
------------------------------------------------

 

With my suggested fix, this test fails:  TestHierarchicalXMLConfiguration#testXmlNodeTypes 

So we probably need another one.

I also discovered that child with spaces will get returned properly if the parent tag owns
the xml:space="preserve".  In other words this works :
<test>  <tagParent xml:space="preserve">
    <tagChild>   </tagChild>
  </tagParent></test>
White this does not:
<test>  <tagParent>
    <tagChild xml:space="preserve">   </tagChild>
  </tagParent></test>
 

Shouldn't "tagChild" spaces be preserved in both cases?

> 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