Question

I'am using Configuration 1.6.

I hava a xml file, like

<property>
    <name>sql</name>
    <value><![CDATA[select a, b from c]]></value>
</property>

I wish to get "select a, b from c" as a whole string, but i get "select a" and "b from c" as List instead.

You may suggest I join the string's with commas, but somewhere else in my project depends on this property.

Was it helpful?

Solution

Change the property of PropertiesConfiguration object like this:

AbstractConfiguration.setListDelimiter(0);

Setting the delimiter to 0 will disable value splitting completely.

That should work.

OTHER TIPS

Using commons configuration 1.9 it is recommend to use:

    config = new XMLConfiguration();
    config.setListDelimiter((char) 0);
    config.setDelimiterParsingDisabled(true);
    config.setAttributeSplittingDisabled(true);
    config.load(resource);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top