Copied to clipboard

Flag this post as spam?

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


  • Connie DeCinko 931 posts 1159 karma points
    Aug 05, 2010 @ 18:23
    Connie DeCinko
    0

    Get nodes, node count in v.4.5.1 schema

    I have a property that displays a checkbox list.  The result is a comma delimited list.  I am trying to use the code snippet below to take the list and convert it to nodes.  I have two items in the list but get a return count of zero.  Is this the correct code for the new schema?

        <xsl:variable name="preNodes">
          <xsl:variable name="advertisements" select="$currentPage/advertisements" />
          <xsl:variable name="nodeIds" select="umbraco.library:Split($advertisements, ',')" />
          <xsl:for-each select="$nodeIds/value">
            <xsl:copy-of select="umbraco.library:GetXmlNodeById(.)"/>
          </xsl:for-each>
        </xsl:variable>
        
        <xsl:variable name="nodes" select="msxml:node-set($preNodes)/node" />
        
        <xsl:value-of select="count($nodes//node)" />
  • Morten Bock 1867 posts 2140 karma points MVP 2x admin c-trib
    Aug 05, 2010 @ 18:57
    Morten Bock
    0

    Try this at the end:

        <xsl:variable name="nodes" select="msxsl:node-set($preNodes)" />
    
        <xsl:value-of select="count($nodes/*[@isDoc])" />
    
  • Connie DeCinko 931 posts 1159 karma points
    Aug 05, 2010 @ 19:12
    Connie DeCinko
    0

    That was it, thanks!

     

  • 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