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] [Resolved] (CONFIGURATION-446) XMLConfiguration removes empty attributes on update
Date Wed, 20 Apr 2011 20:18:05 GMT

     [ https://issues.apache.org/jira/browse/CONFIGURATION-446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Oliver Heger resolved CONFIGURATION-446.
----------------------------------------

       Resolution: Fixed
    Fix Version/s: 1.7

A fix was applied in subversion at revision 1095501. Thanks for the report.

> XMLConfiguration removes empty attributes on update
> ---------------------------------------------------
>
>                 Key: CONFIGURATION-446
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-446
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.6
>            Reporter: Ghislain Del├ępine
>            Assignee: Oliver Heger
>             Fix For: 1.7
>
>
> Consider an XML configuration file config.xml containing:
> <configuration>
> <foo attr="aValue">
> </foo>
> </configuration>
> Update the configuration to set an attribute to empty:
>     XMLConfiguration config = new XMLConfiguration("config.xml");
>     config.setExpressionEngine(new XPathExpressionEngine());
>     
>     config.setProperty("foo/@attr", "");
>     config.save();
> The file has been modified as follows:
> <configuration>
> <foo/>
> </configuration>
> The attribute shouldn't be removed as an empty attribute is different from a missing
attribute.
> Method removing the attribute: XMLConfiguration$XMLBuilderVisitor.updateAttribute(Node
node, Element elem, String name, char listDelimiter)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message