4 Replies Latest reply on Apr 23, 2020 1:37 PM by Ranganath Samudrala

    Is it possible to add other options to the xsl:output node in TSO?

    Greg Michael
      Share This:

      We're running TSO v8.2.0. In the Development Studio, I'm trying to generate a pseudo-dynamic case statement wherein the input context item is plain text and passed in as a token. The XSLT transform I've created does a normalize-space and translate to force the text to be clean and all lowercase. In the template, I run a choose:when block to determine what output to provide back to the workflow based upon the input in the token. In the preview drawer, I can get the output I desire, but it always includes the XML declaration. I know that it's possible to override this in the output node of the Stylesheet, but the XSLT editor does not seem to allow for this. I'd like to include the "method='text'" and "omit-xml-declaration='yes'" options in the output node.

       

      Anyone have a magic method for accomplishing this?

       

      Thanks!

       

      XML stylesheet:

      <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

        <xsl:output indent="no" />

        <xsl:param name="action-lower" select="translate(normalize-space(&quot;${ACTION}&quot;),'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz')" />

        <xsl:template match="/">

          <xsl:choose>

            <xsl:when test="starts-with($action-lower, &quot;enable&quot;)">

              <xsl:choose>

                <xsl:when test="contains($action-lower,&quot;delay&quot;) and contains($action-lower,&quot;manual&quot;) and not( contains($action-lower,&quot;nostart&quot;) )">

                  <xsl:text disable-output-escaping="no">Enable - Delay Manual</xsl:text>

                </xsl:when>

                <xsl:when test="contains($action-lower,&quot;delay&quot;) and contains($action-lower,&quot;nostart&quot;) and not( contains($action-lower,&quot;manual&quot;) )">

                  <xsl:text disable-output-escaping="no">Enable - Delay NoStart</xsl:text>

                </xsl:when>

                <xsl:when test="contains($action-lower,&quot;delay&quot;) and not( contains($action-lower,&quot;manual&quot;) and contains($action-lower,&quot;nostart&quot;) )">

                  <xsl:text disable-output-escaping="no">Enable - Delayed Start</xsl:text>

                </xsl:when>

                <xsl:when test="contains($action-lower,&quot;delay&quot;) and contains($action-lower,&quot;manual&quot;) and contains($action-lower,&quot;nostart&quot;)">

                  <xsl:text disable-output-escaping="no">Enable - Delay NoStart Manual</xsl:text>

                </xsl:when>

                <xsl:otherwise />

              </xsl:choose>

              <xsl:text disable-output-escaping="no">Enable - Delayed Start</xsl:text>

            </xsl:when>

            <xsl:when test="starts-with($action-lower,&quot;disable&quot;)">

              <xsl:choose>

                <xsl:when test="contains($action-lower,&quot;nonstop&quot;)">

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

                </xsl:when>

                <xsl:otherwise>

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

                </xsl:otherwise>

              </xsl:choose>

            </xsl:when>

            <xsl:otherwise>

              <xsl:text disable-output-escaping="no">${ACTION}</xsl:text>

            </xsl:otherwise>

          </xsl:choose>

        </xsl:template>

      </xsl:stylesheet>

       

      Sample output as seen in the preview drawer:

      <?xml version="1.0" encoding="UTF-8"?>Enable - Delay NoStart Manual