Copied to clipboard

Flag this post as spam?

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


  • suzyb 464 posts 877 karma points
    Jan 10, 2012 @ 17:00
    suzyb
    0

    Check doctype of parent node

    In my site map I only want to output nodes of type "tab" if they are not under a "Course" page.

    I can check for the Tab node like so

    name() = 'Tab'

    But I can't work out how to check the node's parent doctype.  I thought something like this..

    current()/../name()

    but it doesn't work.  How can I check the doctype of the parent node.

  • Tom Fulton 2030 posts 4996 karma points c-trib
    Jan 10, 2012 @ 17:04
    Tom Fulton
    1

    Hi,

    You can use the parent axis:

    <xsl:if test="./parent::Tab">the parent is of type Tab</xsl:if>

    or

    <xsl:if test="not(./parent::Tab)">the parent is not of type Tab</xsl:if>

    Hope this helps,
    Tom

  • suzyb 464 posts 877 karma points
    Jan 10, 2012 @ 17:11
    suzyb
    0

    Thank You it does :D

  • 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