commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 30597] New: - HierarchicalConfigurationXMLReader stores comments as text nodes
Date Wed, 11 Aug 2004 14:58:40 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=30597>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30597

HierarchicalConfigurationXMLReader stores comments as text nodes

           Summary: HierarchicalConfigurationXMLReader stores comments as
                    text nodes
           Product: Commons
           Version: Nightly Builds
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Configuration
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: woodman@iswsolutions.com


I am seeing behavior in the HierarchicalConfigurationXMLReader class (v 1.5 
2004/07/05 09:54:17) where XML Comments are inappropriately stored as text 
nodes.   

When using ConfigurationXMLDocument (ConfigurationXMLDocument.java,v 1.6 
2004/06/24 14:01:03) to write the configuration back out to a file, the 
original XML comments are written out as concatenated text nodes. 

Here are the steps for recreation:

1) Read in this configuration using the hierarchicalXml designator:

<config>
    <!-- Settings for the Wizard, now externalized via Perl. -->
    <Wizard>
        <!-- Location of perl binary. -->
        <PerlPath>C:/cygwin/bin/perl</PerlPath>

        <!-- Perl script and arguments for the wizard. -->
        <WizardScript>C:/foo/wizard.pl</WizardScript>
    </Wizard>
</config>

2) Pass the HierarchicalXMLConfiguration instance to ConfigurationXMLDocument 
to write() to a file:

ConfigurationXMLDocument configDoc = new ConfigurationXMLDocument(config);
Writer out = new BufferedWriter(new FileWriter(outputFile));
configDoc.write(out);

3) The resulting XML (written out by Dom4J) demonstrates that all comments were 
read in and concatenated into text nodes:

<config>Settings for the Wizard, now externalized via Perl.  
  <Wizard>Location of perl binary. Perl script and arguments for the wizard.
    <PerlPath>C:/cygwin/bin/perl</PerlPath>
    <WizardScript>C:/foo/wizard.pl</WizardScript>
  </Wizard>
</config>

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


Mime
View raw message