substring-after Not Working in apply-templates

Hi All,
I am trying this statement:

<xsl:apply-templates select="substring-after(@rdf:about,'#')">
</xsl:apply-templates>

But this gives an error saying:
MyXSLFile.xsl:39: value of expression cannot be converted to a node-set

Can anyone guide me how can I write the result of this substring-after thing into an XML file. Do I have to use any other tag rather than xsl:apply-templates or what?

Btw, I tried using following code:
<xsl:for-each select="@rdf:about">
<xsl:value-of select="substring-after(@about,'#')"/>
</xsl:for-each>

which (atleast) generates the XML file, but the file does not show any substring extracted.

Please Help...
[778 byte] By [Ahsan] at [2007-11-19 1:08:07]
# 1 Re: substring-after Not Working in apply-templates
Hi All,
I am trying this statement:

<xsl:apply-templates select="substring-after(@rdf:about,'#')">
</xsl:apply-templates>

But this gives an error saying:
MyXSLFile.xsl:39: value of expression cannot be converted to a node-set

Substring-after returns a string, so this should hardly be a surprise.

Btw, I tried using following code:
<xsl:for-each select="@rdf:about">
<xsl:value-of select="substring-after(@about,'#')"/>
</xsl:for-each>
which (atleast) generates the XML file, but the file does not show any substring extracted.

Well suppose something like
<xsl:for-each select="@rdf:about">
<xsl:value-of select="substring-after(text(),'#')"/>
</xsl:for-each>

Might do. But I don't understand why you use the for-each, you are selecting a specific attribute from the current node, this will always be singular, so you might as well write
<xsl:value-of select="substring-after(@rdf:about,'#')"/>

If this doesn't work you need to show us your source XML file, and some more of your stylesheet, so I can see the things in their proper context.
khp at 2007-11-10 3:28:02 >