Spin XML adds blank lines if input is already pretty printed

XMLWordPrintable

    • Type: Bug Report
    • Resolution: Fixed
    • Priority: L3 - Default
    • 7.18.0, 7.18.0-alpha2
    • Affects Version/s: 7.14.0, 7.15.0
    • Component/s: spin
    • None

      Environment (Required on creation):

      Tested on Camunda 7.14

      Steps to reproduce (Required on creation):

      Add an already formatted XML into a SPIN variable 

       

      SpinXmlElement spinXml = Spin.XML(value);
      execution.setVariable ("test", spinXml);

      Let's assume value is the following XML: 

       

      <test>
        <message>Camunda is awesome!</message>
      </test>  
      

      Then the value is either shown in the UI or is read by the java api using

      execution.getVariable("test");
      

       

      Observed Behavior (Required on creation):

      The value is shown as:

      <test>
      
        <message>Camunda is awesome!</message>
      
      </test>  
      

      Expected behavior (Required on creation):

      <test>
        <message>Camunda is awesome!</message>
      </test> 
      

      Root Cause (Required on prioritization):

      The XML is formatted again and any CR returns an empty line. When reading the XML and then inserting it again any blank line is even doubled. 

      Solution Ideas (Optional):

      Make DomXmlDataFormatWriter prettyPrint aware and strip empty lines. 

      Hints (Optional):

            Assignee:
            Thorben Lindhauer
            Reporter:
            Joern Muehlencord
            Thorben Lindhauer Thorben Lindhauer
            Nikola Koevski Nikola Koevski
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: