Forum Discussion

5 Replies

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Robert,

     

    As far as I see, the discussion has stopped as there was no answer from the topic starter. Could you please describe your task and the issue you faced in detail?

     

    • rf's avatar
      rf
      Occasional Contributor

       Hello Tanya!

      The issue is that pretty print trims the content inside nodes in the XML.

      E.g. I receive a response from the application:

      <Person>

         <Surname>Smith   </Surname>

      </Person>

      The value for surname in the database is "Smith   " and I wan't to compare the value in the XML with the value in the db using GroovyUtils.

       

      However due to the trimming issue in pretty print the XML that is stored inside the XmlHolder is:

      <Person>

         <Surname>Smith</Surname>

      </Person>

       

      Hence, when I compare the values the assertion failes because "Smith" != "Smith   ".

      If I disable pretty print the correct value is returned, but the XML is not very readable (a typical response in my application is +5000 chars).

       

      As I see it, pretty print altering the content of a node is a defect since the actual content of the response changes.

       

      Best Regards

      Robert

      • TanyaYatskovska's avatar
        TanyaYatskovska
        SmartBear Alumni (Retired)

        Hi Robert,

         

        Thanks for your explanation. Didn’t you try the suggestion posted here to remove spaces from a response?

  • stevedearl's avatar
    stevedearl
    New Contributor

    Hi SmartBear,

     

    What's the status of this issue as we're seeing similar problems....

     

    thanks,

    Steve