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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2
    • 2.3
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: