On Sun, Oct 24, 2021 at 05:42:38PM -0000, Trevor Nicholls
trevor(_at_)castingthevoid(_dot_)com scripsit:
[why is this test of version attributes afflicting me?]
I am not going to claim I fully understand the logic you've presented,
but I think you've got three cases:
1. the context item doesn't have an @version
2. the context item has an @version which does NOT differ by value from the
first ancestor @version attribute
3. the context item has an @version which differs by value from the first
ancestral @version attribute
In which case, I don't think you want:
<xsl:variable name="ancv" select=ancestor::*[@version][1]" />
I think you'd want something like (just typed! here! not in oXygen!)
<!-- I would reflexively do this on attributes but I think you want the
element context for page position -->
<xsl:variable name="versions" as="element()+"
select="ancestor-or-self::*[normalize-space(@version)])" />
<xsl:choose>
<xsl:when test="not(self::*[normalize-space(@version)]">
<!-- the context item doesn't have a version;
the context item's closest ancestral version is $versions[1] -->
</xsl:when>
<xsl:when test="$versions[1]/@version eq $versions[2]/@version">
<!-- the context item version matches the closest ancestor version -->
</xsl:when>
<xsl:when test="$versions[1]/@version ne $versions[2]/@version">
<!-- the context item version is different from the closest ancestor
version
-->
</xsl:when>
<xsl:otherwise>
<xsl:message>Something completely unexpected has happened</xsl:message>
</xsl:otherwise>
</xsl:choose>
Is that somewhere in the vague vicinity?
--
Graydon Saunders | graydonish(_at_)gmail(_dot_)com
Þæs oferéode, ðisses swá mæg.
-- Deor ("That passed, so may this.")
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--