Copied to clipboard

Flag this post as spam?

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


  • Chris Gaskell 59 posts 142 karma points
    Feb 25, 2010 @ 15:00
    Chris Gaskell
    0

    Some help wioth setting a subset of nodes into a variable

    Hey,

    I'm building an RSS Feed (well fixing it actually) and it has to work across different child doc types. The Child doc types all ahev the correct properties.

    So what mi trying to do is:

      <xsl:variable name="DataSource">
        <xsl:choose>
            <xsl:when test="$currentPage [@nodeTypeAlias = 'K-KnowledgeArticle']">
                <xsl:value-of select="$currentPage//node [@alias = 'K-KnowledgeArticle']"/>
            </xsl:when>
    <xsl:when text="...">
    etc
            <xsl:otherwise>
            </xsl:otherwise>
        </xsl:choose>
      </xsl:variable>

    Then:

    <xsl:for-each select="$DataSource">
          <xsl:sort select="@createDate" data-type="text" order="descending" />
          <xsl:if test="position() = 1">

    ......

    Is that possible?

    Thanks.

  • Chris Gaskell 59 posts 142 karma points
    Feb 25, 2010 @ 15:01
    Chris Gaskell
    0

    Cripes, sorry for the typos...

  • Chris Gaskell 59 posts 142 karma points
    Feb 25, 2010 @ 15:03
    Chris Gaskell
    0

    Sorry - should have added the error message on save:

    Error occured
    System.Xml.Xsl.XslTransformException:
    To use a result tree fragment in a path expression, first convert it to
    a node-set using the msxsl:node-set() function.
    
    at System.Xml.Xsl.Runtime.XsltConvert.EnsureNodeSet(IList`1 listItems) at pubDate(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
  • dandrayne 1138 posts 2262 karma points
    Feb 25, 2010 @ 15:07
    dandrayne
    100

    Hows about using (it may be msxml:node-set, i can never remember).  If the below doesn't work post the copy-of output of your variable se I can see the structure

    <xsl:for-each select="msxsl:node-set($DataSource)">
  • Chris Gaskell 59 posts 142 karma points
    Feb 25, 2010 @ 15:16
    Chris Gaskell
    0

    Got it, thanks Dan.

Please Sign in or register to post replies

Write your reply to:

Draft