substring-before demo : substring before « XSLT stylesheet « XML






substring-before demo

File: Data.xml
<poem>
  <verse>line 1</verse>
  <verse>

    line 2

  </verse>
</poem>

File: Transform.xslt
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  version="1.0">
  <xsl:output method="xml" omit-xml-declaration="yes" indent="no" />
  <xsl:template match="verse">
    <xsl:value-of select="substring-before(.,'dreary')" />
  </xsl:template>

  
</xsl:stylesheet>

 








Related examples in the same category

1.substring-before() function