(Maybe it's better to have this discussion on the mailing list.)

The implementation of attributes in the experimental branch was probably incomplete - the node handlers only supported single attribute values, XMLConfiguration still had this splitting code.

As I already pointed out in this ticket, the reason for the implementation of attribute splitting was that the configuration API allows calling addProperty() multiple times for attribute keys. So an attempt was made to map those "artificial" attributes to valid XML. However, looking at all the consequences of this implementation, the question is whether this is really worth the whole trouble.

So I tend to disable this feature in the experimental branch. In addProperty() we can check whether an attribute is to be added that already exists and for instance throw a ConfigurationRuntimeException in this case.

If somebody has a better solution or other suggestions, please let me know.

Oliver


Ralph Goers (JIRA) schrieb:
[ https://issues.apache.org/jira/browse/CONFIGURATION-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12698059#action_12698059 ]
Ralph Goers commented on CONFIGURATION-335:
-------------------------------------------

I added attribute splitting to the experimental branch. If we decide to not 
allow attribute splitting we can remove it.

XMLConfiguration: Can't disable attribute splitting ----------------------------------------------------

                Key: CONFIGURATION-335
                URL: https://issues.apache.org/jira/browse/CONFIGURATION-335
            Project: Commons Configuration
         Issue Type: Bug
         Components: Format
   Affects Versions: 1.5
           Reporter: Sergey Vladimirov
           Assignee: Oliver Heger
            Fix For: 1.6


My XML configuration has the following attribute:
<some-element some-attribute="&#x0A;&#x0D;" />
But XML Configuration is trying to split this string and trims it after splitting. I 
don't need this behaviour, but setting setDelimiterParsingDisabled() just changing 
delimeter to "|" and not disables attribute trimming.
Need either to disable trimming/splitting if setDelimiterParsingDisabled() is 
set to TRUE (incompatible change), or add something like 
setParseAttributesAsIs() that will prevent attributes to be trimmed and splitted


Reply via email to