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

XMLPropertyListConfiguration cannot save arrays in the correct plist form

    XMLWordPrintableJSON

Details

    Description

      groovy> import org.apache.commons.configuration.plist.* 
      groovy> def config = new XMLPropertyListConfiguration() 
      groovy> config.addProperty("things", ['chair', 'hat', 'door'])  
      groovy> config.save(System.out) 
      

      results in

      <?xml version="1.0"?>
      <!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
      <plist version="1.0">
          <dict>
              <key>things</key>
              <string>chair</string>
      
              <key>things</key>
              <string>hat</string>
      
              <key>things</key>
              <string>door</string>
          </dict>
      </plist>
      

      expecting

      <?xml version="1.0"?>
      <!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
      <plist version="1.0">
          <dict>
              <key>things</key>
              <array>
                <string>chair</string>
                <string>hat</string>
                <string>door</string>
            </array>
          </dict>
      </plist>
      

      Attachments

        1. configuration-427.patch
          10 kB
          Emmanuel Bourg
        2. configuration-427-2.patch
          4 kB
          Oliver Heger

        Issue Links

          Activity

            People

              ebourg Emmanuel Bourg
              smee matthew smith
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: