Following XLST code works fine :-
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:template match="/">
<xsl:for-each select="bookstore/book">
<xsl:if test="starts-with(author, 'W')"> <!-- Line 1 -->
<xsl:value-of select="title" />
  by
<xsl:value-of select="author" />
<br/>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Here I am directly using XPath String function starts-with() in Line 1.
Now, as per W3Schools, adding the namespace for XPath functions (http://www.w3.org/2005/xpath-functions), the following code does not work :-
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fn="http://www.w3.org/2005/xpath-functions" version="1.0">
<xsl:template match="/">
<xsl:for-each select="bookstore/book">
<xsl:if test="fn:starts-with(author, 'W')"> <!-- Line 2 -->
<xsl:value-of select="title" />
  by
<xsl:value-of select="author" />
<br/>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Here, I am using the XPath function with its prefix attached to the namespace.
IE shows that "Error: Namespace 'http://www.w3.org/2005/xpath-functions' does not contain any functions" I checked the URL and it does have functions.
Where am I going wrong? And if I can use all XPath functions with Transform URL itself, then why is a separate URL for XPath functions is provided?