Copied to clipboard

Flag this post as spam?

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


  • Victor 2 posts 32 karma points
    Nov 12, 2013 @ 10:07
    Victor
    0

    Error parsing XSLT System.Xml.Xsl.XslCompiledTransform

    Hi,

    I'm maintaining a Umbraco installation on a shared hosting managed by a Plesk Control Panel. The version is "umbraco v 4.0.1 (Assembly version: 1.0.3373.718)" and the Hosting is ASPNET 2.0.

    There seems that Plesk CP has some issues and the site suddenly ran into problems. After I restored privileges I start having an issue that I didn't have before with the XSLT files. They haven't been changed or anything has not been published in a while. So I don't understand the nature of this issue.

    The debug of any page in the site throws an error like:

    Error parsing XSLT System.Xml.Xsl.XslCompiledTransform
    El valor del atributo'order' debe ser 'ascending' o 'descending'. Error en C:\Inetpub\vhosts\XXXX\httpdocs\xslt\ListNewsEventsOnHome.xslt(36,1).
      en System.Xml.Xsl.Runtime.XmlQueryRuntime.ThrowException(String text)
      en System.Xml.Xsl.CompiledQuery.Query.<xsl:template match="/">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, Double {urn:schemas-microsoft-com:xslt-debug}position, Double {urn:schemas-microsoft-com:xslt-debug}last, IList`1 {urn:schemas-microsoft-com:xslt-debug}namespaces) en C:\Inetpub\vhosts\XXXX\httpdocs\xslt\ListNewsEventsOnHome.xslt:línea 35
      en System.Xml.Xsl.CompiledQuery.Query.<xsl:apply-templates>(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator , Double , Double )
      en System.Xml.Xsl.CompiledQuery.Query.Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
      en System.Xml.Xsl.CompiledQuery.Query.Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
      en System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results)
      en System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer, Boolean closeWriter)
      en System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter results)
      en System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, TextWriter results)
      en System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results)
      en umbraco.macro.GetXsltTransformResult(XmlDocument macroXML, XslCompiledTransform xslt, Dictionary`2 parameters)
      en umbraco.macro.loadMacroXSLT(macro macro, Hashtable attributes, Hashtable pageElements)
    

    The content of the ListNewsEventsOnHome is:

    <?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"/>
    
    <xsl:variable name="SortOrder" select="$currentPage/ancestor-or-self::node[@level=1]/descendant::node [@nodeTypeAlias = 'NewsEventsListPage']/data [@alias = 'SortOrder']" />  
    <xsl:variable name="SortBy" select="$currentPage/ancestor-or-self::node[@level=1]/descendant::node [@nodeTypeAlias = 'NewsEventsListPage']/data [@alias = 'SortBy']" /> 
    
    <xsl:variable name="NumberofItemsToDisplay" select="$currentPage/data [@alias = 'NoNewsEvents']" />
    
    <xsl:template match="/">
    
    <xsl:variable name="DataType">  
        <xsl:choose>  
            <xsl:when test="$SortBy='sortOrder'">  
                <xsl:value-of select="'number'" />  
            </xsl:when>  
            <xsl:otherwise>  
                <xsl:value-of select="'text'" />  
            </xsl:otherwise>  
        </xsl:choose>  
    </xsl:variable>
    
    
    <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()&lt;= $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="./data [@alias = 'EventDate'] !=''">
                        <em><xsl:value-of select="umbraco.library:FormatDateTime(./data [@alias = 'EventDate'], 'd MMMM, yyyy')"/></em>
                    </xsl:if>
                </a>
            </li>
        </xsl:if>
    </xsl:for-each>
    </ul>
    
    </xsl:template>
    
    </xsl:stylesheet>
    

    We didn't change any code so I don't understand what is the issue here. Why it was working before and now is not.

    Any pointer will be very much appreciated. Regards, Victor

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Nov 12, 2013 @ 10:32
    Chriztian Steinmeier
    100

    Hi Victor - welcome to OUR !

    I don't understand spanish (that's what I'm guessing it is, anyway) - but the error seems to indicate that the $SortOrder variable doesn't get computed to either "ascending" or "descending", which is required.

    It seems like that could happen if the is no NewsEventsListPage published in the site — do you know if all pages have been republished?

    /Chriztian

  • Victor 2 posts 32 karma points
    Nov 12, 2013 @ 17:24
    Victor
    0

    Hi Chriztian,

    Thanks for your advice. I re-published the whole site right clicking on the root node and I thought that was enough. But obviously not all the pages were republished. After publishing folder by folder everything is back to normal.

    Kind Regards, Victor

Please Sign in or register to post replies

Write your reply to:

Draft