[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Problem using xsl:if to skip a node in a repeating area


Subject: Re: [xsl] Problem using xsl:if to skip a node in a repeating area
From: Sean Gallagher <sean@xxxxxxxxxx>
Date: Thu, 15 Dec 2005 09:00:37 -0500

On Dec 15, 2005, at 1:43 AM, Ragulf Pickaxe wrote:

Hi Sean,

<xsl:variable name='checkti' select='{title}' />

The variable should not have curly brackets in its select. <xsl:variable name='checkti' select='title' />

Thanks, Ragulf. I caught that as I was going back through it. But it's still not working.


Here's the full xslt fragment:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp "&#160;">
<!ENTITY copy "&#169;">
<!ENTITY reg "&#174;">
<!ENTITY trade "&#8482;">
<!ENTITY mdash "&#8212;">
<!ENTITY ldquo "&#8220;">
<!ENTITY rdquo "&#8221;">
<!ENTITY pound "&#163;">
<!ENTITY yen "&#165;">
<!ENTITY euro "&#8364;">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/ Transform">
<xsl:output method="html" encoding="ISO-8859-1"/>
<xsl:param name="ItemsPerPage" select="4" />
<xsl:template match="/">
<xsl:for-each select="rss/channel/item[position() &lt;= $ItemsPerPage]">
<xsl:variable name='adstring' select='ADV' />
<xsl:variable name='checkti' select="title" />
<xsl:if test="not(starts-with($checkti,$adstring))">
<li><a href='{link}'><xsl:value-of select="title"/></a></li>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>


I'm still getting an unspecified error .

<xsl


Current Thread
Keywords