2 Replies Latest reply on May 14, 2020 11:19 AM by Supriya Shah

    Need assistance on XSLT/ XPath/ Basic transofrmation

    Supriya Shah
      Share This:



      I am getting windows command adapter response in below format. I need to sent it in email in such a way that each line item displays in new line. I am storing it in a context item and sending that context item in email body.



                  <line index="1">Copyright 2010 BMC Software Ltd, Version: 1.6.2  </line>

                  <line index="2">Connecting to remote service...</line>

                  <line index="3">Connected to remote host.</line>

                  <line index="4">==================================================</line>

                  <line index="5">ABCDEFGH</line>

                  <line index="6">==================================================</line>

                  <line index="7">***** PROVIDED VALUES *****</line>

                  <line index="8">REGION : Americas</line>

                  <line index="9">ARCHIVE FILE : XYZ</line>

                  <line index="10">REQUEST NO : REQ112233</line>

                  <line index="11">***** VERIFYING *****</line>

                  <line index="12">REGION : OK</line>

                  <line index="13">SRC DISPATCH : OK (http://*****)</line>

                  <line index="14">DST DISPATCH : OK (http://*****)</line>

                  <line index="15">SRC UNC PATH : OK (//*****)</line>

                  <line index="16">DST UNC PATH : OK (//*****)</line>

                  <line index="17">ZIP VERIFIED : Error! Verification failed. This may be due to various reasons such as invalid files in zip, encrypted contents or file not found.</line>

                  <line index="18">Error! One or more verification steps failed! Exiting... </line>

                  <line index="19">Remote application exited with code: 0 </line>




      Ways I have tried:


      1. Basic transformation - Extract all XML tag content to text (new tag is new line)

      - It works fine when preview, but when sending in an email, it appears in single line string


      2. XSLT  -

           <xsl:for-each select="//line">

              <xsl:value-of select="." disable-output-escaping="no" />

              <xsl:text disable-output-escaping="no">