Copied to clipboard

Flag this post as spam?

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


  • Ashok Raja 12 posts 32 karma points
    Oct 14, 2010 @ 17:50
    Ashok Raja
    0

    Need help to convert 4.0 XSLT schema to 4.5

    Please help in converting these 4.0.3 XSLT schema to 4.5.2

    <xsl:variable name="homePagePath" select="umbraco.library:GetXmlNodeById($currentPage/ancestor-or-self::node[@level = '1'][@nodeTypeAlias = 'HomePage']/@id)"/>
    <xsl:apply-templates select="$rootNodePath/node/node[@nodeName = $currentPage/@nodeName]/node[@nodeTypeAlias != 'Navigation']">
    <xsl:when test="$currentPage/node[@nodeTypeAlias = $faqItemAlias]">
    <xsl:for-each select="$rootNodePath/descendant::node/node">
    <xsl:variable name="Parent" select="$currentPage/parent::node/@nodeTypeAlias"/>

     

  • Kim Andersen 1447 posts 2196 karma points MVP
    Oct 14, 2010 @ 17:55
    Kim Andersen
    1

    Hi Ashok

    Try theese:

    <xsl:variable name="homePagePath" select="umbraco.library:GetXmlNodeById($currentPage/ancestor-or-self::HomePage[@level = '1']/@id)"/>

    <xsl:apply-templates
    select="$rootNodePath/*[@isDoc]/*[@isDoc][@nodeName = $currentPage/@nodeName]/Navigation">

    <xsl:when test="$currentPage/*[@isDoc][name() = $faqItemAlias]">

    <xsl:for-each select="$rootNodePath/descendant::*[@isDoc]/*[@isDoc]">

    <xsl:variable name="Parent" select="$currentPage/parent::*[@isDoc]/name()"/>

    Just from the top of my head, but I think they should work :)

    /Kim A

  • Ashok Raja 12 posts 32 karma points
    Oct 14, 2010 @ 18:09
    Ashok Raja
    0

    Thanks Kim.

    All seems OK except for

    <xsl:variable name="Parent" select="$currentPage/parent::*[@isDoc]/name()"/>

    and <xsl:variable doesn't seem to like it.

     

  • Kim Andersen 1447 posts 2196 karma points MVP
    Oct 14, 2010 @ 20:52
    Kim Andersen
    0

    Ahh, what!? :D

    What doesn't seem to like what? And didn't the last one work or? If not, do you get any errors in Visual Studio when hovering the error?

    /Kim A

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Oct 14, 2010 @ 21:17
    Chriztian Steinmeier
    1

    Yeah - this can be a little misleading sometimes - but think of it as a static method in C# or similar; instead of calling name() on the node, feed the node into the name() function:

    <xsl:variable name="Parent" select="name($currentPage/parent::*[@isDoc])" />

    /Chriztian 

    
    
                
  • Ashok Raja 12 posts 32 karma points
    Oct 15, 2010 @ 10:17
    Ashok Raja
    0

    Kim - yes, the last one didn't work and in VS when hovering displays the message - Expected end of the expression,............

    Chriztian - Many thanks!. It worked.

Please Sign in or register to post replies

Write your reply to:

Draft