Copied to clipboard

Flag this post as spam?

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


  • Dima Surkov 2 posts 22 karma points
    Feb 06, 2014 @ 16:44
    Dima Surkov
    0

    Error parsing xslt file happens periodically umbraco 4.7.2.

    Hello, 

    We have a simple navigation menu on our portal. 99% of the time it works perfect but sometimes it causes:

    'Error parsing XSLT file: \xslt\HomePageNavigation.xslt'. 

    The problem is that I got stuck trying to reproduce this issue. It just occurs randomly more likely when user was inactive for some time.

    It is not a critical issue but still I would be thankful for any helpful thoughts. 

    Thanks.

    <?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" select="/.."/>
    
      <!-- Input the documenttype you want here -->
      <!-- Typically '1' for topnavigtaion and '2' for 2nd level -->
      <!-- Use div elements around this macro combined with css -->
      <!-- for styling the navigation -->
      <xsl:variable name="level" select="1"/>
    
      <xsl:template match="/">
    
        <!-- The fun starts here -->
        <ul>
          <xsl:for-each select="$currentPage/ancestor-or-self::* [@isDoc and @level=$level]/* [@isDoc and string(umbracoNaviHide) != '1']">
            <li >
              <a href="{umbraco.library:NiceUrl(@id)}">
                <xsl:if test="$currentPage/ancestor-or-self::*/@id = current()/@id">
                  <!-- we're under the item - you can do your own styling here -->
                  <xsl:attribute name="class">selected</xsl:attribute>
                </xsl:if>
                <xsl:value-of select="@nodeName"/>
              </a>
    
            </li>
          </xsl:for-each>
        </ul>
    
      </xsl:template>
    
    </xsl:stylesheet>
  • Fuji Kusaka 2203 posts 4220 karma points
    Feb 06, 2014 @ 16:59
    Fuji Kusaka
    0

    Can you try chaning your for each to

    <xsl:param name="currentPage"/>
    <!-- Input the documenttype you want here -->
    <xsl:variable name="level" select="1"/>
    <xsl:for-each select="$currentPage/ancestor-or-self::* [@level=$level]/* [@isDoc][not(umbracoNaviHide =1)]">
  • Dima Surkov 2 posts 22 karma points
    Feb 06, 2014 @ 17:08
    Dima Surkov
    0

    Yes, that seems a bit cleaner code, you are right. But both conditions seem to be working well enough, so I feel that this is not a source of the problem, do you agree with me? Thanks for the feedback anyway.

  • Fuji Kusaka 2203 posts 4220 karma points
    Feb 06, 2014 @ 17:20
    Fuji Kusaka
    0

    Yes i do agree with you but give this a try, might be some issues with the code as well.

     

Please Sign in or register to post replies

Write your reply to:

Draft