xslt doesn't work after 4.5 upgrade with UseLegacyXmlSchema set to true
I have completed an upgrade from 4 to 4.52 and set the <UseLegacyXmlSchema>true</UseLegacyXmlSchema>. I also republished the entire site. However, none of my xslt work stil. I've supplied one of my xslt's below that I use for a footer navigation. There is not error in xslt below, it just is empty. If anyone has any ideas let me know. I had not planned to have to update all my xslt with this upgrade and instead to do it over time, but right now I would spend the time to rewrite it if that work. Thanks for any help!
<!-- update this variable on how deep your site map should be --> <xsl:variable name="maxLevelForSitemap" select="3"/> <xsl:variable name="c" select="1"/> <xsl:variable name="h" select="1"/> <xsl:template match="/"> <xsl:call-template name="drawNodes"> <xsl:with-param name="parent" select="$currentPage/ancestor-or-self::node [@level=1]"/> </xsl:call-template> </xsl:template>
Thanks for the reply. I don't use any custom xslt extensions, just what's already provided in the umbraco library. My xslextensions.config file is empty.
One thing I just noticed is the /umbraco/app_data/umbraco.config is empty. Is that correct? I really don't know what it's used for, but I've heard it referenced as something to look at.
That's another thing that is new in this version. The old file is in the /data/umbraco.config, I would suggest copying everything from the /data/ to /app_data/
There is data in the /app_data/umbraco.config. I was just looking in the wrong place I guess (I found 3 of these in different spots). So I guess that's not the issue.
Can anyone see why my xslt would not work? Should I just change to the new schema and try to rewrite everything?
Ok, I figured it out. Even using the old schema, there are still changes apparently that you have to make. The one I ran into is using * instead of node. So for example I had $currentPage/ancestor-or-self::node which had to be changed to $currentPage/ancestor-or-self::*.
xslt doesn't work after 4.5 upgrade with UseLegacyXmlSchema set to true
I have completed an upgrade from 4 to 4.52 and set the <UseLegacyXmlSchema>true</UseLegacyXmlSchema>. I also republished the entire site. However, none of my xslt work stil. I've supplied one of my xslt's below that I use for a footer navigation. There is not error in xslt below, it just is empty. If anyone has any ideas let me know. I had not planned to have to update all my xslt with this upgrade and instead to do it over time, but right now I would spend the time to rewrite it if that work. Thanks for any help!
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp " ">
]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt" xmlns:umbraco.library="urn:umbraco.library" exclude-result-prefixes="msxml
umbraco.library ">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<!-- update this variable on how deep your site map should be -->
<xsl:variable name="maxLevelForSitemap" select="3"/>
<xsl:variable name="c" select="1"/>
<xsl:variable name="h" select="1"/>
<xsl:template match="/">
<xsl:call-template name="drawNodes">
<xsl:with-param name="parent" select="$currentPage/ancestor-or-self::node [@level=1]"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="drawNodes">
<xsl:param name="parent"/>
<xsl:if test="$parent/@id != ''">
<xsl:if test="umbraco.library:IsProtected($parent/@id, $parent/@path) = 0 or (umbraco.library:IsProtected($parent/@id, $parent/@path) = 1 and umbraco.library:IsLoggedOn() = 1)">
<xsl:for-each select="$parent/node [string(./data [@alias='umbracoNaviHide']) != '1' and @level <= $maxLevelForSitemap]">
<xsl:if test="@nodeTypeAlias != 'Partner' and @nodeTypeAlias != '301Redirect'">
<div id="footer-content-pods">
<xsl:choose>
<xsl:when test="current()/data[@alias='footerLinkTitle'] != ''">
<xsl:variable name="displayName" select="current()/data[@alias='footerLinkTitle']"/>
<xsl:choose>
<xsl:when test="@level = 2">
<span class="lead">
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="current()/data[@alias='footerLinkTitle']"/>
</a>
</span>
<br/>
<hr class="hr"/>
<!--<a href="{umbraco.library:NiceUrl(@id)}"><xsl:value-of select="data[@alias='bodyTitle']/text()"/></a><br />
<hr class="hr" />-->
</xsl:when>
<xsl:otherwise>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="current()/data[@alias='footerLinkTitle']"/>
</a><br/>
<hr class="hr"/>
<!-- <xsl:if test="@nodeName = 'Resources'">
<a href="/site-map.aspx">Site Map</a><br />
<hr class="hr" />
</xsl:if> -->
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="displayName" select="current()/@nodeName"/>
<xsl:choose>
<xsl:when test="@level = 2">
<span class="lead">
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="current()/@nodeName"/>
</a>
</span>
<br/>
<hr class="hr"/>
<!--<a href="{umbraco.library:NiceUrl(@id)}"><xsl:value-of select="current()/@nodeName"/></a><br />
<hr class="hr" />-->
</xsl:when>
<xsl:otherwise>
<a href="{umbraco.library:NiceUrl(@id)}">
<xsl:value-of select="current()/@nodeName"/>
</a><br/>
<hr class="hr"/>
<!-- <xsl:if test="@nodeName = 'Resources'">
<a href="/site-map.aspx">Site Map</a><br />
<hr class="hr" />
</xsl:if> -->
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="c" select="c + 1"/>
<xsl:if test="count(./node [string(./data [@alias='umbracoNaviHide']) != '1' and @level <= $maxLevelForSitemap]) > 0">
<xsl:call-template name="drawNodes">
<xsl:with-param name="parent" select="."/>
</xsl:call-template>
</xsl:if>
</div>
</xsl:if>
</xsl:for-each>
</xsl:if>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
Do you have any custom XSLT extensions? I know that one of the changes affects the way that you include custom extensions.
You may want to look at the xsltExtensions.config file. The assembly attribute should not contain /bin/ in the path, so for example this:
becomes this:
Thanks for the reply. I don't use any custom xslt extensions, just what's already provided in the umbraco library. My xslextensions.config file is empty.
One thing I just noticed is the /umbraco/app_data/umbraco.config is empty. Is that correct? I really don't know what it's used for, but I've heard it referenced as something to look at.
That's another thing that is new in this version. The old file is in the /data/umbraco.config, I would suggest copying everything from the /data/ to /app_data/
There is data in the /app_data/umbraco.config. I was just looking in the wrong place I guess (I found 3 of these in different spots). So I guess that's not the issue.
Can anyone see why my xslt would not work? Should I just change to the new schema and try to rewrite everything?
Ok, I figured it out. Even using the old schema, there are still changes apparently that you have to make. The one I ran into is using * instead of node. So for example I had $currentPage/ancestor-or-self::node which had to be changed to $currentPage/ancestor-or-self::*.
is working on a reply...