commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ghislain Del├ępine (JIRA) <>
Subject [jira] [Created] (CONFIGURATION-446) XMLConfiguration removes empty attributes on update
Date Fri, 15 Apr 2011 08:47:05 GMT
XMLConfiguration removes empty attributes on update

                 Key: CONFIGURATION-446
             Project: Commons Configuration
          Issue Type: Bug
    Affects Versions: 1.6
            Reporter: Ghislain Del├ępine

Consider an XML configuration file config.xml containing:

<foo attr="aValue">

Update the configuration to set an attribute to empty:

    XMLConfiguration config = new XMLConfiguration("config.xml");
    config.setExpressionEngine(new XPathExpressionEngine());
    config.setProperty("foo/@attr", "");;

The file has been modified as follows:


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:

View raw message