Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • [email protected] 30 posts 42 karma points
    Nov 22, 2010 @ 16:32
    r_lamb@hotmail.com
    0

    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 "&#x00A0;">
    ]>
    <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 &lt;= $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 &lt;= $maxLevelForSitemap]) &gt; 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>


  • Sean Mooney 131 posts 158 karma points c-trib
    Nov 22, 2010 @ 17:09
    Sean Mooney
    0

    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:

    <ext assembly="/bin/umbraco.editorControls" type="umbraco.editorControls.tags.library" alias="tagsLib" />

    becomes this:

    <ext assembly="/umbraco.editorControls" type="umbraco.editorControls.tags.library" alias="tagsLib" />

     

  • [email protected] 30 posts 42 karma points
    Nov 22, 2010 @ 18:26
    r_lamb@hotmail.com
    0

    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.

  • [email protected] 30 posts 42 karma points
    Nov 22, 2010 @ 18:35
    r_lamb@hotmail.com
    0

    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.

  • Sean Mooney 131 posts 158 karma points c-trib
    Nov 22, 2010 @ 18:39
    Sean Mooney
    0

    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/

  • [email protected] 30 posts 42 karma points
    Nov 22, 2010 @ 18:47
    r_lamb@hotmail.com
    0

    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?

  • [email protected] 30 posts 42 karma points
    Nov 22, 2010 @ 20:56
    r_lamb@hotmail.com
    0

    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::*.

Please Sign in or register to post replies

Write your reply to:

Draft