commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oliver Heger (JIRA)" <>
Subject [jira] Commented: (CONFIGURATION-268) XMLConfiguration does not fully support disabled delimiter parsing
Date Sun, 06 May 2007 20:46:15 GMT


Oliver Heger commented on CONFIGURATION-268:

Attributes are also affected, but here the situation is more complicated: We support multiple
values for a single attribute, so somebody could do something like this:

XMLConfiguration conf = new XMLConfiguration();
conf.addProperty("test[@attr]", "1,2,3");
conf.addProperty("test[@attr]", "4,5,6");

If such a configuration is saved, our current implementation will produce the following element:
<test attr="1\,2\,3,4\,5\,6"/>
If this element is loaded when delimiter parsing is disabled, an attribute with two values
is created, but the values contain the escaping character. (Note that this is not a problem
when delimiters are enabled.)

I think if delimiter parsing is disabled, attribute values should be read as they are without
doing any modifications like removing escape characters. They may be part of the real attribute
value. But because XML does not allow multiple occurrences of a single attribute, we always
need a delimiter character for representing multiple attribute values. Now when loading a
configuration file and delimiter parsing is disabled, deciding whether a delimiter character
is used is not trivial. What we could do is using an untypical delimiter character, e.g. the
pipe. Then the example element would look like
<test attr="1,2,3|4,5,6"/>
If an attribute value contained this delimiter character, it would have to be escaped. But
we still cannot be 100% sure whether the user in deed wants to define an attribute with the
single value "1,2,3\|4,5,6".

> XMLConfiguration does not fully support disabled delimiter parsing
> ------------------------------------------------------------------
>                 Key: CONFIGURATION-268
>                 URL:
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.4
>            Reporter: Oliver Heger
>         Assigned To: Oliver Heger
>             Fix For: 1.5
> A call to setDelimiterParsingDisabled(true) should completely turn off the mechanism
for searching for list delimiters and splitting property values.
> However escapes list delimiters even in this mode. When later
such a configuration file is loaded and delimiter parsing is turned off, the values of affected
properties will contain the escape character.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

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

View raw message