Long story short. Upgraded from 3 to 4.0.2 very long time ago and the site have been running smooth.
I managed to solve it on my own though. For some reason the sort command in the xslt was no longer able to dig in to the news list and catch the sortOrder and sortBy. So I changed both variables to catch both sort values on the currentpage and that works fine now.
But I'm puzzled how a working site where I haven't done any alterations at all suddenly acts up like that!?
Before I found the solution I also tried to place an xsl:if around the for-each statement. Came out with no errors but also no output. So that solution didn't work for this issue.
Anyway, you get the solved 'credits' for replying :-)
XSLT list news suddenly makes parsing error!
Hi all,
I have an xslt macro that has started to fail out of the blue it seems. It's been working fine until now.
It's run on an upgraded 4.0.2 install.
Ihave have made no chagnes on the site for a long time, so this sudden parsing error irritates me a lot.
the xslt:
<ul id="NewsList">
<xsl:for-each select="$currentPage/ancestor-or-self::node[@level=1]/descendant::node [@nodeTypeAlias = 'NewsEventsListPage']/node [string(data [@alias='umbracoNaviHide']) != '1']">
<xsl:sort select="@*[name() = $SortBy]" order="{$SortOrder}" data-type="{$DataType}"/>
<xsl:if test="position()<= $NumberofItemsToDisplay">
<xsl:variable name="Class">
<xsl:choose>
<xsl:when test="@nodeTypeAlias='Event'">
<xsl:value-of select="'Event'" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'News'" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<li class="{$Class}">
<a title="{@nodeName}" href="{umbraco.library:NiceUrl(@id)}">
<strong><xsl:value-of select="@nodeName"/></strong><br/>
<xsl:if test="./@updateDate !=''">
<em><xsl:value-of select="umbraco.library:FormatDateTime(./@updateDate, 'd. MMMM yyyy, ')"/></em>
</xsl:if> <xsl:value-of select="@writerName"/>
</a>
</li>
</xsl:if>
</xsl:for-each>
</ul>
</xsl:template>
</xsl:stylesheet>
When saving the xslt i know get this error:
That's complete nonsene to me I'm afraid :-)
Hi Claus
What version have you upgraded Umbraco to?
/Jan
Hi Jan ,
Long story short. Upgraded from 3 to 4.0.2 very long time ago and the site have been running smooth.
I managed to solve it on my own though. For some reason the sort command in the xslt was no longer able to dig in to the news list and catch the sortOrder and sortBy. So I changed both variables to catch both sort values on the currentpage and that works fine now.
But I'm puzzled how a working site where I haven't done any alterations at all suddenly acts up like that!?
Before I found the solution I also tried to place an xsl:if around the for-each statement. Came out with no errors but also no output. So that solution didn't work for this issue.
Anyway, you get the solved 'credits' for replying :-)
is working on a reply...