Copied to clipboard

Flag this post as spam?

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


  • praveity 100 posts 125 karma points
    Apr 28, 2011 @ 13:47
    praveity
    0

    Select $matchedNodes of Specific Doc type

    On the  <xsl:for-each select="$matchedNodes"/> loop; it selects multiple matched nodes of different document types.

    How can I check if the $matchedNodes is of certain document type?

    like 

    <xsl:when test="$matchedNodes/self::SC_ServiceCategory[@isDoc] | $matchedNodes/self::SC_ServiceItem[@isDoc]"/>

    This is not working for me.

     

  • Sebastiaan Janssen 4894 posts 14626 karma points MVP admin hq
    Apr 28, 2011 @ 15:18
    Sebastiaan Janssen
    0

    As you can see, $matchedNodes is plural, it doesn't have just 1 type, but the nodes are all of a different type. So if you want to filter then, you should do that in the for-each loop and check it like:

    <xsl:if test="./local-name() = 'MyType'">
    ..Do something
    </xsl:if>
  • praveity 100 posts 125 karma points
    Apr 28, 2011 @ 19:25
    praveity
    0

    Hi Sebastiaan 

    You are absolutely right, I just managed to find solution the same way.

    Thanks for the help.

Please Sign in or register to post replies

Write your reply to:

Draft