Copied to clipboard

Flag this post as spam?

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


  • jerome 5 posts 25 karma points
    Apr 05, 2011 @ 10:33
    jerome
    0

    Error on saving XSLT file : Expression must evaluate to a node-set.

    Hello,

     

    I'm facing a problem when I want to save an xslt file in the back office.

    I have this error

    System.Xml.Xsl.XslTransformException: Expression must evaluate to a node-set. 
    at System.Xml.Xsl.Runtime.XsltConvert.EnsureNodeSet(IList`1 listItems)

    The XSLT file is :

    <xsl:variable name="rootNode" select="umbraco.library:getHome($currentPage/ancestor-or-self::node [@nodeTypeAlias = 'Home'])"/>
     <li class="toggleSubMenu">
            <a  id="{$rootNode/@id}" class="top_menu" href="{umbraco.library:NiceUrl($rootNode/@id)}">
              Accueil
            </a>
     </li>

    On my developpement PC I can save this file BUT not on my testing environnement ...

    Can anyone help me?

    Thank you.


  • Kim Andersen 1447 posts 2196 karma points MVP
    Apr 05, 2011 @ 19:13
    Kim Andersen
    2

    Hi Jerome

    I don't know the umbraco.library extension called getHome, and actually I don't think that there's anyone called this unless you developed it yourself (if the extension actually exists, I'd like to know :) ). What should the extension do?

    If you are just trying to create a link to your homepage you can do this:

    <li class="toggleSubMenu">
            <a class="top_menu" href="/">
              Accueil
            </a>
     </li>

    But if you want to grab the homepage with a document type of "Home", you can do like this in the legacy XML schema:

    <xsl:variable name="rootNode" select="$currentPage/ancestor-or-self::node [@nodeTypeAlias = 'Home']"/>

    and like this in the new XML schema:

    <xsl:variable name="rootNode" select="$currentPage/ancestor-or-self::Home"/>

    I hope this helps you out.

    /Kim Andersen

  • jerome 5 posts 25 karma points
    Apr 12, 2011 @ 11:23
    jerome
    0

    Thank you for your help.

    GetHome is a customised function and there was an error for the name @nodeTypeAlias = 'Home'.

     

    Now its working with the riht name



  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies