1

I have the following two functions in XSLT 1.0

  • ShortenDetail
  • RemoveHTML

I am trying to first clean "Detail" column using RemoveHTML function and then I want to shorten it using ShortenDetail function.

This is how I am doing it but it is not working and giving error.

<xsl:call-template name="ShortenDetail">
     <xsl:call-template name="RemoveHtml">
           <xsl:with-param name="String" select="@Detail"/>
     </xsl:call-template>
</xsl:call-template>

How do I use nested functions in XSLT?

1 Answer 1

1

It depends how ShortenDetail template is implemented.

For templates:

    <!-- Fake ShortenDetail -->  
    <xsl:template name="ShortenDetail">
         <xsl:param name="String" />
         <xsl:value-of select="$String"/>
    </xsl:template>

   <!-- Fake RemoveHtml -->
   <xsl:template name="RemoveHtml">
     <xsl:param name="String" />
     <xsl:value-of select="$String"/>
   </xsl:template>

this is the correct way to chain/pipe templates:

<xsl:call-template name="ShortenDetail">
        <xsl:with-param name="String">
             <xsl:call-template name="RemoveHtml">
                       <xsl:with-param name="String" select="@Detail"/>
              </xsl:call-template>
       </xsl:with-param>
</xsl:call-template>
1
  • Ok I will have a look at it in the morning tomorrow. Commented Aug 3, 2013 at 17:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.