commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Heger <>
Subject Re: [configuration] save xml list element
Date Wed, 11 Jan 2017 17:03:33 GMT

Am 11.01.2017 um 10:04 schrieb
> I`m reading a xml configuration object with a xml element containing a comma separated
> <SSLEnabledProtocols>TLSv1.1,TLSv1.2</SSLEnabledProtocols>
> I archive this by setting explicitly a ListDelimiterHandler
> this.xmlConfigBuilder = new FileBasedConfigurationBuilder<XMLConfiguration>(ExtendedXMLConfiguration.class)
>                                         .configure(params.xml().setFile(configFile).setExpressionEngine(new
>                                                         .setListDelimiterHandler(new
> and the reading is fine, but when I write this out I got separate xml elements for each
value instead of the same comma separated value element.
> <SSLEnabledProtocols>TLSv1.1</SSLEnabledProtocols>
> <SSLEnabledProtocols>TLSv1.2</SSLEnabledProtocols>

the current implementation of XMLConfiguration internally always splits
strings containing the delimiter character on reading and creates
multiple internal node objects for the single values. This is required
to handle queries correctly that operate on the internal node model. So
when writing out such a configuration the original format is lost and
multiple list nodes are created.

I would, however, assume that a change in the format only occurs if
there is a change in the value of the property or if the content of a
configuration is copied into another one. When loading an XML file the
configuration stores the original DOM and applies changes on it as
necessary. That way the original format should be kept as close as
possible. Are there such changes in your use case?



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message