J
johkar
I am having trouble figuring out how to use preceding sibling when I am
already on the node. I have a feeling that you cannot use
preceding-sibling on an attribute, but I can't figure out the syntax.
XML:
<leftcol>
<nav type="extra" location="top">
<boxlink href="#">Link 1</boxlink>
</nav>
<nav type="extra" location="bottom">
<boxlink href="#">Link 1</boxlink>
</nav>
<nav type="right">
<boxlink href="#">Link 1</boxlink>
</nav>
</leftcol>
<xsl:apply-templates select="/leftcol/nav" />
<xsl:if test="@type='extra' and not(@type=preceding-sibling::./@type)">
<!-- More XSL -->
</xsl:if>
The goal is to only output one nav with a type of extra.
already on the node. I have a feeling that you cannot use
preceding-sibling on an attribute, but I can't figure out the syntax.
XML:
<leftcol>
<nav type="extra" location="top">
<boxlink href="#">Link 1</boxlink>
</nav>
<nav type="extra" location="bottom">
<boxlink href="#">Link 1</boxlink>
</nav>
<nav type="right">
<boxlink href="#">Link 1</boxlink>
</nav>
</leftcol>
<xsl:apply-templates select="/leftcol/nav" />
<xsl:if test="@type='extra' and not(@type=preceding-sibling::./@type)">
<!-- More XSL -->
</xsl:if>
The goal is to only output one nav with a type of extra.