tags:

views:

54

answers:

3

Im getting on error when I try and use the following:

<xsl:variable name="url" select="guid"/>     
<xsl:variable name="vid" select="substring-after($url,'podcast/')"/>
<xsl:variable name="pre" select="substring-before($vid,'.mp4')"/>

<<xsl:variable name="p" select="replace($pre,'_','-')"/>
<xsl:variable name="p1" select="concat($p,'.embed_thumbnail.jpg')"/>
<xsl:variable name="p2" select="concat('http://images.ted.com/images/ted/tedindex/embed-posters/',$p1)"/&gt;

Can anyone see a problem, it all looks good to me?

A: 

You have an extra unescaped less-than sign before your p variable's definition:

<<xsl:variable name="p" select="replace($pre,'_','-')"/>

That's not valid syntax.

You should either remove it:

<xsl:variable name="p" select="replace($pre,'_','-')"/>

Or escape it:

&lt;<xsl:variable name="p" select="replace($pre,'_','-')"/>
Welbog
Didnt fix the problem but stepo in the right direciton.
danit
A: 

I see a '<<' at the start of line 4, is that it?

+1  A: 

Are you using an XSLT 1 processor? The replace function appeared in XPath 2.0 and is therefore not available in XSLT 1.

In this case you could just use the translate function instead.

Jukka Matilainen