You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sergey Vladimirov (JIRA)" <ji...@apache.org> on 2008/08/14 19:27:44 UTC

[jira] Created: (CONFIGURATION-335) XMLConfiguration: Can't disable attribute splitting

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


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

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


[jira] Reopened: (CONFIGURATION-335) XMLConfiguration: Can't disable attribute splitting

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CONFIGURATION-335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oliver Heger reopened CONFIGURATION-335:
----------------------------------------


So I was too quick when closing this ticket.

The attribute splitting functionality was added because there is a mismatch between the configuration API and the capabilities provided by XML: the configuration API allows adding multiple values to an attribute while XML only supports a single value. For instance, you can have something like this:

{code}
config.addProperty("element[@attr]", "value1");
config.addProperty("element[@attr]", "value2");
{code}

When storing such a configuration, how should the multiple values of the attribute be treated so that the file can be loaded again and the resulting configuration is not changed? Because the problem is inherent there is so far no possibility of switching off this feature.

It might make sense to introduce a flag for turning off this mechanism. Can you give an example (other than that with whitespace) where this attribute splitting functionality caused undesired behavior?

> 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
>             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

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


[jira] Resolved: (CONFIGURATION-335) XMLConfiguration: Can't disable attribute splitting

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CONFIGURATION-335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oliver Heger resolved CONFIGURATION-335.
----------------------------------------

    Resolution: Fixed
      Assignee: Oliver Heger

XMLConfiguration now has a new property {{attributeSplittingDisabled}}. If set to *true*, the values of attributes are stored in exactly the way as they are returned by the XML parser, without further modification.

Note that this property must be set *before* the configuration is loaded. So the following pattern has to be used:

{code}
XMLConfiguration config = new XMLConfiguration();
config.setAttributeSplittingDisabled(true);
config.setFile(myConfigFile);
config.load();
{code}

This is analogous to the {{delimiterParsingDisabled}} property of {{AbstractConfiguration}}.

> 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

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


Re: [configuration] attribute splitting WAS Re: [jira] Commented: (CONFIGURATION-335) XMLConfiguration: Can't disable attribute splitting

Posted by Ralph Goers <ra...@dslextreme.com>.
On Apr 11, 2009, at 8:26 AM, Oliver Heger wrote:

> (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.
>

I'm fine with this solution.  I just needed to get all my unit tests  
to pass.

If we intentionally disable "lists" in xml attributes that makes  
perfect sense to me. At the same time we will have to go through all  
the unit tests and remove the logic that depends on attribute splitting.

I need a todo list :-)  Maybe I'll make a page on the wiki to track  
this stuff.

Ralph


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


[configuration] attribute splitting WAS Re: [jira] Commented: (CONFIGURATION-335) XMLConfiguration: Can't disable attribute splitting

Posted by Oliver Heger <ol...@oliver-heger.de>.
(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
> 


[jira] Commented: (CONFIGURATION-335) XMLConfiguration: Can't disable attribute splitting

Posted by "Ralph Goers (JIRA)" <ji...@apache.org>.
    [ 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

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


[jira] Resolved: (CONFIGURATION-335) XMLConfiguration: Can't disable attribute splitting

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CONFIGURATION-335?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oliver Heger resolved CONFIGURATION-335.
----------------------------------------

       Resolution: Invalid
    Fix Version/s: 1.6

This is not a problem of attribute splitting operations performed by XMLConfiguration. The attribute values have already been modified by the XML parser. So closing this issue as invalid.

> 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
>             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

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


[jira] Commented: (CONFIGURATION-335) XMLConfiguration: Can't disable attribute splitting

Posted by "Sergey Vladimirov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12651176#action_12651176 ] 

Sergey Vladimirov commented on CONFIGURATION-335:
-------------------------------------------------

Oliver,

Is parser doing "|" splitting? I thought it was line 487 in XMLConfiguration:

                Iterator it = PropertyConverter.split(
                        attr.getValue(),
                        isDelimiterParsingDisabled() ? ATTR_VALUE_DELIMITER
                                : getListDelimiter()).iterator();



> 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
>             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

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


[jira] Commented: (CONFIGURATION-335) XMLConfiguration: Can't disable attribute splitting

Posted by "Ralph Goers (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12698052#action_12698052 ] 

Ralph Goers commented on CONFIGURATION-335:
-------------------------------------------

I don't understand. XMLConfiguration in the experimental branch has a method named processAttributes that splits the attribute into Nodes.  I have a config file for DefaultConfigurationBuilder that requires a ',' in it and it doesn't work. I replaced the property converter call with List<String> values = Collections.singletonList(attr.getValue()); and my DefaultConfgurationBuilder test worked fine, but a whole bunch of other unit tests now fail because attribute splitting isn't supported.

I either need to add the option to the experimental branch or disable attribute splitting entirely, otherwise I can't commit my new code to the experimental branch. What would you prefer?

> 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

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


[jira] Commented: (CONFIGURATION-335) XMLConfiguration: Can't disable attribute splitting

Posted by "Courtney B. Arnold (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12623346#action_12623346 ] 

Courtney B. Arnold commented on CONFIGURATION-335:
--------------------------------------------------

FYI for anyone else who is encountering this bug. The parsing is not a delayed parsing. It begins parsing the document once you have used it's constructor. So the work around would be to construct an XMLConfiguration object without any parameters, use the setDelimiterParsingDisabled(true), then load the xml file. Like so:

	File configurationFile = new File("test.xml");
	XMLConfiguration configuration = new XMLConfiguration();
	configuration.setDelimiterParsingDisabled(true);
	configuration.load(configurationFile);

> 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
>
> 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

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


[jira] Commented: (CONFIGURATION-335) XMLConfiguration: Can't disable attribute splitting

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12659348#action_12659348 ] 

Oliver Heger commented on CONFIGURATION-335:
--------------------------------------------

No, it was not. The implementation of attributes is different in the experimental branch: attributes are not represented as Nodes, but each node has a map of attributes. Currently there is no direct support for multiple values of an attribute. See also the {{NodeHandler}} interface, which defines only a {{setAttributeValue()}} and a {{getAttributeValue()}} method.

For the experimental branch it makes certainly sense to redesign the whole splitting mechanism. Looking back, it has caused us a lot of trouble, and I am wondering if it is worth the whole pain.

> 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

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


[jira] Commented: (CONFIGURATION-335) XMLConfiguration: Can't disable attribute splitting

Posted by "Sergey Vladimirov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12627412#action_12627412 ] 

Sergey Vladimirov commented on CONFIGURATION-335:
-------------------------------------------------

Courtney,

setDelimiterParsingDisabled() doesn't work for XMLConfiguration - it just changing delimeter to "|"

> 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
>
> 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

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


[jira] Commented: (CONFIGURATION-335) XMLConfiguration: Can't disable attribute splitting

Posted by "Sergey Vladimirov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12622615#action_12622615 ] 

Sergey Vladimirov commented on CONFIGURATION-335:
-------------------------------------------------

Or at least constructHierarchy() and processAttributes() methods should be protected - to enable extending/changing behaviour

> 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
>
> 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

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


[jira] Commented: (CONFIGURATION-335) XMLConfiguration: Can't disable attribute splitting

Posted by "Sergey Vladimirov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12651763#action_12651763 ] 

Sergey Vladimirov commented on CONFIGURATION-335:
-------------------------------------------------

Oliver,

The problem were found with regular expression. Regexp can contain both commas and "|" characters.
"\[\[some\, |other\, \]\]"

For me switching off this mechanism should result in some limitation, but it's okay as far as program does know about it and not using multiple attribute values mechanism.

Sergey

> 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
>             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

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


[jira] Commented: (CONFIGURATION-335) XMLConfiguration: Can't disable attribute splitting

Posted by "Sergey Vladimirov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12622617#action_12622617 ] 

Sergey Vladimirov commented on CONFIGURATION-335:
-------------------------------------------------

XMLNode class (member of XMLConfiguration) should be protected, as well as handleDelimiters(node, node) method.

It seems no one tried to extend this class before...

> 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
>
> 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

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


[jira] Commented: (CONFIGURATION-335) XMLConfiguration: Can't disable attribute splitting

Posted by "Sergey Vladimirov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12651341#action_12651341 ] 

Sergey Vladimirov commented on CONFIGURATION-335:
-------------------------------------------------

Both actually.

It called "Can't disable attribute splitting", so unable to disable splitting was main problen

> 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
>             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

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


[jira] Commented: (CONFIGURATION-335) XMLConfiguration: Can't disable attribute splitting

Posted by "Sergey Vladimirov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12627414#action_12627414 ] 

Sergey Vladimirov commented on CONFIGURATION-335:
-------------------------------------------------

Oliver,

It's my code - i want to specify any possible xml parsing option i need. It's okay if XMLConfiguration doesn't support such behaviour - then it should allow me to change it in subclass.

> 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
>
> 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

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


[jira] Issue Comment Edited: (CONFIGURATION-335) XMLConfiguration: Can't disable attribute splitting

Posted by "Sergey Vladimirov (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12651176#action_12651176 ] 

bsp edited comment on CONFIGURATION-335 at 11/26/08 3:05 PM:
---------------------------------------------------------------------------

Oliver,

Is parser doing "|" splitting? I thought it was line 487 in XMLConfiguration:

    /** Constant for the delimiter for multiple attribute values.*/
    private static final char ATTR_VALUE_DELIMITER = '|';

.......
                Iterator it = PropertyConverter.split(
                        attr.getValue(),
                        isDelimiterParsingDisabled() ? ATTR_VALUE_DELIMITER
                                : getListDelimiter()).iterator();



      was (Author: bsp):
    Oliver,

Is parser doing "|" splitting? I thought it was line 487 in XMLConfiguration:

                Iterator it = PropertyConverter.split(
                        attr.getValue(),
                        isDelimiterParsingDisabled() ? ATTR_VALUE_DELIMITER
                                : getListDelimiter()).iterator();


  
> 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
>             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

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


[jira] Commented: (CONFIGURATION-335) XMLConfiguration: Can't disable attribute splitting

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12622651#action_12622651 ] 

Oliver Heger commented on CONFIGURATION-335:
--------------------------------------------

I think your request is not in line with the XML specification. Have a look at http://www.w3.org/TR/REC-xml/#AVNormalize where the concept of attribute normalization is defined.

What you can do is using the content of an element instead of an attribute. Recently support for the xml:space attribute was added to XMLConfiguration (see CONFIGURATION-307). If this attribute is set on an element, whitespace in its content will be preserved. However, the current version 1.5 does not contain this feature yet.

> 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
>
> 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

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


[jira] Commented: (CONFIGURATION-335) XMLConfiguration: Can't disable attribute splitting

Posted by "Ralph Goers (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12659289#action_12659289 ] 

Ralph Goers commented on CONFIGURATION-335:
-------------------------------------------

Was this applied to the experimental branch?

> 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

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


[jira] Commented: (CONFIGURATION-335) XMLConfiguration: Can't disable attribute splitting

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12651264#action_12651264 ] 

Oliver Heger commented on CONFIGURATION-335:
--------------------------------------------

The parser is certainly not doing "|" splitting, but it trims whitespace. As I understand this ticket this is your original problem, isn't 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
>             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

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


[jira] Commented: (CONFIGURATION-335) XMLConfiguration: Can't disable attribute splitting

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CONFIGURATION-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12628885#action_12628885 ] 

Oliver Heger commented on CONFIGURATION-335:
--------------------------------------------

My point is that the problem you are facing with the definition of CR and LF sequences in attributes is not caused by any attribute trimming or splitting activities of XMLConfiguration. Rather the XML parser already performs attribute normalization and replaces your sequence by a single white space. So even if you had access to the corresponding methods in XMLConfiguration, it would not help you because the strings passed to these methods have already been modified by the parser.

> 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
>
> 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

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