You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Ma...@swisscom.com on 2003/06/17 10:35:59 UTC

Parse string in XSL

Is it possible to parse a string in XSL?
I have this variable : <xsl:value-of select="cn"/> who is ABC\DEF
I want to get DEF
Is there any function in XSL to do this?
Thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: Parse string in XSL

Posted by Joerg Heinicke <jo...@gmx.de>.
This time it must be correct, because you already said XSL ;-)

<xsl:value-of select="substring-after($cn, '\')"/>

Should return 'DEF' if there is a '\' in the variable $cn. But it 
returns nothing if there is no '\' in it! If this makes a difference you 
can test whether

contains($cn, '\')

:-)

Regards,

Joerg

Maxime.Gheysen@swisscom.com wrote:
> Is it possible to parse a string in XSL?
> I have this variable : <xsl:value-of select="cn"/> who is ABC\DEF
> I want to get DEF
> Is there any function in XSL to do this?
> Thanks


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org