commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Heger (JIRA)" <>
Subject [jira] [Resolved] (CONFIGURATION-500) Attributes in xml config should apply to all entries of a list
Date Sat, 08 Sep 2012 15:00:08 GMT


Oliver Heger resolved CONFIGURATION-500.

    Resolution: Fixed

I agree that your proposal of handling attributes for list elements is more intuitive. {{XMLConfiguration}}
will now behave in this way.

Fixed in subversion in revision 1382310.
> Attributes in xml config should apply to all entries of a list
> --------------------------------------------------------------
>                 Key: CONFIGURATION-500
>                 URL:
>             Project: Commons Configuration
>          Issue Type: Improvement
>          Components: Expression engine
>    Affects Versions: 1.8
>         Environment: Linux, Windows
>            Reporter: Alex Selg
>            Assignee: Oliver Heger
>             Fix For: 2.0
> If you have an XML configuration with lists and attributes like this:
> {code:xml}
> <configuration>
>        <someStrings environment="test">str1,str2,str3</someStrings>
>        <someStrings environment="prod">str4,str5,str6</someStrings>
> </configuration>
> {code}
> and if you have a different implementation of the DefaultExpressionEngine which implements
the query() methode to check these attributes
> {code}
>        List<ConfigurationNode> queryResults = super.query(root, key);
>        for (ConfigurationNode queryResult : queryResults) {
>            attributes = queryResult.getAttributes();
>            ...
>        }
> {code}
> than you'll only get the attributes for the first node of the list - the
> subsequent nodes don't have any attributes set.
> So for "str1" I'll get the attribute environment="test", for "str2"
> and "str3" I'll get no attributes.
> Oliver H. pointed out that this is the intended behaviour (
> I think it would be more straightforward assigning attributes to all nodes of a list.
Otherwise the list feature seems incomlete to me.
> Especially if your lists are a bit longish it would be very nice to avoid repeating tags
in your config.xml.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message