Uploaded image for project: 'Commons Configuration'
  1. Commons Configuration
  2. CONFIGURATION-428

The Windows file path cannot be saved correctly as expected in XMLConfiguration

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.6
    • Fix Version/s: 1.7
    • Component/s: None
    • Labels:
      None
    • Environment:

      WIN2K3

      Description

      I want to generate a XML as:

      <?xml version="1.0" encoding="UTF-8" standalone="no"?>
      <Test>
          <Cluster>
              <Server location="C:\Server92"/>
          </Cluster>
      </Test>
      

      Java Code:

      Test.java
      XMLConfiguration config = new XMLConfiguration();
      config.setRootElementName("Test");
      config.addProperty("Cluster.Server[@location]",  "C:\\Server92");
      config.save("C:\\NEW.xml");
      

      BUT after running the Java Code, the generated XML looks like:

      <?xml version="1.0" encoding="UTF-8" standalone="no"?>
      <Test>
      <Cluster>
      <Server location="C:\\Server92"/>
      </Cluster>
      </Test>
      

      You will find that the location is "C:\ \Server92", BUT what I expected is "C:\Server92".

        Attachments

          Activity

            People

            • Assignee:
              oheger Oliver Heger
              Reporter:
              terrencexu Terrence Xu
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: