Copied to clipboard

Flag this post as spam?

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


  • Mehtab Malik 21 posts 70 karma points
    Jul 31, 2013 @ 18:44
    Mehtab Malik
    0

    XSLT not working after umbraco upgrade (Urgent)

    I updated my xslts using the package and then upgraded umbraco 4.0.3 to 4.5.2 and planning to do upgrade till version 6.x. The upgrade completed fine but my xslts are not working. An exmaple of the xslt is below

    XSLT before upgrade 

    <?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" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">
        <xsl:output method="xml" omit-xml-declaration="yes"/>
        <xsl:param name="currentPage"/>
        <xsl:template match="/">
            <xsl:variable name="imageFolder" select="/macro/imageFolder"/>
            <xsl:variable name="imageFolderContents" select="umbraco.library:GetMedia($imageFolder/node/@id, 'true')"/>
            <div style="clear:both; " class="slideshow">
                <xsl:for-each select="$imageFolderContents/node [@nodeTypeAlias='Image']">
                    <xsl:if test="string(current()/data [@alias='umbracoFile']) != ''">
                        <a href="http://www.marhall.com/booking.aspx">
                            <img alt="{current()/@nodeName}">
                                <xsl:attribute name="src"><xsl:value-of select="current()/data [@alias='umbracoFile']"/><!--                 <xsl:value-of select="umbraco.library:UrlEncode(current()/data [@alias = 'umbracoFile'])" disable-output-escaping="yes" />--></xsl:attribute>
                            </img>
                        </a>
                    </xsl:if>
                </xsl:for-each>
            </div>
        </xsl:template>
    </xsl:stylesheet>
    
    XSLT after upgrade 
    <?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" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">
        <xsl:output method="xml" omit-xml-declaration="yes"/>
        <xsl:param name="currentPage"/>
        <xsl:template match="/">
            <xsl:variable name="imageFolder" select="/macro/imageFolder"/>
            <xsl:variable name="imageFolderContents" select="umbraco.library:GetMedia($imageFolder/node/@id, 'true')"/>
            <div style="clear:both; " class="slideshow">
                <xsl:for-each select="$imageFolderContents/Image">
                    <xsl:variable name="filePath" select="umbracoFile"/>
                    <xsl:if test="normalize-space($filePath)">
                        <a href="http://www.marhall.com/booking.aspx">
                            <!-- Change the link if this is a specific file -->
                            <xsl:if test="$filePath = '/media/42595/marhall_spadayhpbanner_jul131 (4).jpg'">
                                <xsl:attribute name="href">http://gifts.skchase.com/marhall/summerspa/</xsl:attribute>;
                            </xsl:if>
                            <img src="{$filePath}" alt="{current()/@nodeName}"/>
                        </a>
                    </xsl:if>
                </xsl:for-each>
            </div>
        </xsl:template>
    </xsl:stylesheet>

    I have spent lots of time on it and would appreciate any help

    I guess the issue is lying on this line $imageFolderContents/Image   this is always empty.

Please Sign in or register to post replies

Write your reply to:

Draft