XSLT How to extract a string

Extracting strings

  1. Call the template from the xslt

    <xsl:call-template name=ExtractString>
    <xsl:with-param name=ExtractedString selectNodeToBeUsed/>
    </xsl:call-template>
  2. Make this template

    <xsl:template name=ExtractString>
    <xsl:param name=ExtractedString>
    <xsl:variable name=afterbrackets><xsl:value-of select=substring-after($ExtractedString,'(')/></xsl:variable>
    <xsl:value-of select=substring-before($afterbrackets,')')/>
    </xsl:template>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s