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

xml:space="preserve" does not handle blank strings properly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.3
    • Component/s: None
    • Labels:
      None

      Description

      When using XMLConfiguration 2, tags containing only white spaces are not handled properly when xml:space="preserve" is set.  'null' is returned instead of the actual spaces.  To reproduce:

       

      XMLConfiguration xml = new BasicConfigurationBuilder<>(
              XMLConfiguration.class).configure(
                  new Parameters().xml()).getConfiguration();
      FileHandler fh = new FileHandler(xml);
      fh.load(new StringReader("<test xml:space=\"preserve\">    </test>"));
      System.out.println("TEST: '" + xml.getString("") + "'");
      // Outputs   -> TEST: 'null'
      // Should be -> TEST: '    '
      

       

       

       

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              pascal.essiembre Pascal Essiembre
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: