You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by "Janusz Studzizba (JIRA)" <ji...@apache.org> on 2006/11/15 10:29:37 UTC

[jira] Created: (CONFIGURATION-238) XMLConfiguration.save() - illegal new line char in xml comment

XMLConfiguration.save() - illegal new line char in xml comment
--------------------------------------------------------------

                 Key: CONFIGURATION-238
                 URL: http://issues.apache.org/jira/browse/CONFIGURATION-238
             Project: Commons Configuration
          Issue Type: Bug
    Affects Versions: 1.2 Final
         Environment: Windows XP x64
            Reporter: Janusz Studzizba


I have the following conf.xml.
<?xml version="1.0" encoding="UTF-8"?>
<report-server-config>
    <!-- comment 
   new line in comment -->
    <param>value</param>
</report-server-config>

Edited with Vim looks nice.
I use XMLConfiguration to process it.

I perform the following operations:
    XMLConfiguration config = new XMLConfiguration("c:\\conf.xml");
    config.save();

BUG:
After config.save(); my conf.xml file, when edited in Vim, contains additional ^M char at the end of each line. This is very disturbing.

REASON:
There must be a bug in XMLConfiguration when operating on <!-- --> xml comments which contain new line characters - as in my example.
    <!-- comment 
   new line in comment -->
My original conf.xml contained 0D 0A chars as a new line in comment,
after calling config.save();  there is ONLY 0A char there!


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Commented: (CONFIGURATION-238) XMLConfiguration.save() - illegal new line char in xml comment

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/CONFIGURATION-238?page=comments#action_12452003 ] 
            
Oliver Heger commented on CONFIGURATION-238:
--------------------------------------------

This is strange. There is no special handling of comment lines.

XMLConfiguration does the following: It parses the XML configuration file using DOM and keeps the resulting DOM tree in memory. Updates of property values also cause this structure to be modified. When the save() method is called, an identity XSLT transformation is used to write the DOM tree back to a file (this will probably cause the ^M characters when the default new line separator 0D 0A is used for Windows).

I have no idea why comments are treated differently. But as far as I can tell, this is not under the control of XMLConfiguration, but happens during the XML transformation.

> XMLConfiguration.save() - illegal new line char in xml comment
> --------------------------------------------------------------
>
>                 Key: CONFIGURATION-238
>                 URL: http://issues.apache.org/jira/browse/CONFIGURATION-238
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.2 Final
>         Environment: Windows XP x64
>            Reporter: Janusz Studzizba
>
> I have the following conf.xml.
> <?xml version="1.0" encoding="UTF-8"?>
> <report-server-config>
>     <!-- comment 
>    new line in comment -->
>     <param>value</param>
> </report-server-config>
> Edited with Vim looks nice.
> I use XMLConfiguration to process it.
> I perform the following operations:
>     XMLConfiguration config = new XMLConfiguration("c:\\conf.xml");
>     config.save();
> BUG:
> After config.save(); my conf.xml file, when edited in Vim, contains additional ^M char at the end of each line. This is very disturbing.
> REASON:
> There must be a bug in XMLConfiguration when operating on <!-- --> xml comments which contain new line characters - as in my example.
>     <!-- comment 
>    new line in comment -->
> My original conf.xml contained 0D 0A chars as a new line in comment,
> after calling config.save();  there is ONLY 0A char there!

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Commented: (CONFIGURATION-238) XMLConfiguration.save() - illegal new line char in xml comment

Posted by "Janusz Studzizba (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/CONFIGURATION-238?page=comments#action_12451871 ] 
            
Janusz Studzizba commented on CONFIGURATION-238:
------------------------------------------------

Only new line chars in comment lines are modified
[however when edited with Vim - ^M chars are printed in all lines - but this is probably Vim issue]

> XMLConfiguration.save() - illegal new line char in xml comment
> --------------------------------------------------------------
>
>                 Key: CONFIGURATION-238
>                 URL: http://issues.apache.org/jira/browse/CONFIGURATION-238
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.2 Final
>         Environment: Windows XP x64
>            Reporter: Janusz Studzizba
>
> I have the following conf.xml.
> <?xml version="1.0" encoding="UTF-8"?>
> <report-server-config>
>     <!-- comment 
>    new line in comment -->
>     <param>value</param>
> </report-server-config>
> Edited with Vim looks nice.
> I use XMLConfiguration to process it.
> I perform the following operations:
>     XMLConfiguration config = new XMLConfiguration("c:\\conf.xml");
>     config.save();
> BUG:
> After config.save(); my conf.xml file, when edited in Vim, contains additional ^M char at the end of each line. This is very disturbing.
> REASON:
> There must be a bug in XMLConfiguration when operating on <!-- --> xml comments which contain new line characters - as in my example.
>     <!-- comment 
>    new line in comment -->
> My original conf.xml contained 0D 0A chars as a new line in comment,
> after calling config.save();  there is ONLY 0A char there!

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Resolved: (CONFIGURATION-238) XMLConfiguration.save() - illegal new line char in xml comment

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

Oliver Heger resolved CONFIGURATION-238.
----------------------------------------

       Resolution: Won't Fix
    Fix Version/s: 1.4

Got no more feedback on this issue, so closing it. IMO there is nothing we can do about this because the underlying XML parser or the XSLT engine are handling this.

> XMLConfiguration.save() - illegal new line char in xml comment
> --------------------------------------------------------------
>
>                 Key: CONFIGURATION-238
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-238
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.2
>         Environment: Windows XP x64
>            Reporter: Janusz Studzizba
>             Fix For: 1.4
>
>
> I have the following conf.xml.
> <?xml version="1.0" encoding="UTF-8"?>
> <report-server-config>
>     <!-- comment 
>    new line in comment -->
>     <param>value</param>
> </report-server-config>
> Edited with Vim looks nice.
> I use XMLConfiguration to process it.
> I perform the following operations:
>     XMLConfiguration config = new XMLConfiguration("c:\\conf.xml");
>     config.save();
> BUG:
> After config.save(); my conf.xml file, when edited in Vim, contains additional ^M char at the end of each line. This is very disturbing.
> REASON:
> There must be a bug in XMLConfiguration when operating on <!-- --> xml comments which contain new line characters - as in my example.
>     <!-- comment 
>    new line in comment -->
> My original conf.xml contained 0D 0A chars as a new line in comment,
> after calling config.save();  there is ONLY 0A char there!

-- 
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: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


[jira] Commented: (CONFIGURATION-238) XMLConfiguration.save() - illegal new line char in xml comment

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/CONFIGURATION-238?page=comments#action_12451728 ] 
            
Oliver Heger commented on CONFIGURATION-238:
--------------------------------------------

Sorry, I don't fully understand this issue. In which way exactly does the processed file differ from the original one? Are all lines modified or only comment lines?

> XMLConfiguration.save() - illegal new line char in xml comment
> --------------------------------------------------------------
>
>                 Key: CONFIGURATION-238
>                 URL: http://issues.apache.org/jira/browse/CONFIGURATION-238
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.2 Final
>         Environment: Windows XP x64
>            Reporter: Janusz Studzizba
>
> I have the following conf.xml.
> <?xml version="1.0" encoding="UTF-8"?>
> <report-server-config>
>     <!-- comment 
>    new line in comment -->
>     <param>value</param>
> </report-server-config>
> Edited with Vim looks nice.
> I use XMLConfiguration to process it.
> I perform the following operations:
>     XMLConfiguration config = new XMLConfiguration("c:\\conf.xml");
>     config.save();
> BUG:
> After config.save(); my conf.xml file, when edited in Vim, contains additional ^M char at the end of each line. This is very disturbing.
> REASON:
> There must be a bug in XMLConfiguration when operating on <!-- --> xml comments which contain new line characters - as in my example.
>     <!-- comment 
>    new line in comment -->
> My original conf.xml contained 0D 0A chars as a new line in comment,
> after calling config.save();  there is ONLY 0A char there!

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Commented: (CONFIGURATION-238) XMLConfiguration.save() - illegal new line char in xml comment

Posted by "Oliver Heger (JIRA)" <ji...@apache.org>.
    [ http://issues.apache.org/jira/browse/CONFIGURATION-238?page=comments#action_12456937 ] 
            
Oliver Heger commented on CONFIGURATION-238:
--------------------------------------------

Could you perhaps try your tests with a different XML parser and/or XSLT engine (maybe the newest versions of Xerces or Xalan)? I assume you use the versions that are shipped with the JRE, right?

Thanks.

> XMLConfiguration.save() - illegal new line char in xml comment
> --------------------------------------------------------------
>
>                 Key: CONFIGURATION-238
>                 URL: http://issues.apache.org/jira/browse/CONFIGURATION-238
>             Project: Commons Configuration
>          Issue Type: Bug
>    Affects Versions: 1.2 Final
>         Environment: Windows XP x64
>            Reporter: Janusz Studzizba
>
> I have the following conf.xml.
> <?xml version="1.0" encoding="UTF-8"?>
> <report-server-config>
>     <!-- comment 
>    new line in comment -->
>     <param>value</param>
> </report-server-config>
> Edited with Vim looks nice.
> I use XMLConfiguration to process it.
> I perform the following operations:
>     XMLConfiguration config = new XMLConfiguration("c:\\conf.xml");
>     config.save();
> BUG:
> After config.save(); my conf.xml file, when edited in Vim, contains additional ^M char at the end of each line. This is very disturbing.
> REASON:
> There must be a bug in XMLConfiguration when operating on <!-- --> xml comments which contain new line characters - as in my example.
>     <!-- comment 
>    new line in comment -->
> My original conf.xml contained 0D 0A chars as a new line in comment,
> after calling config.save();  there is ONLY 0A char there!

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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