This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
alpha comparison
- To: "xsl list" <xsl-list at mulberrytech dot com>
- Subject: alpha comparison
- From: "Dave Pawson" <dave dot pawson at virgin dot net>
- Date: Sun, 9 Apr 2000 18:40:59 +0100
- Reply-To: xsl-list at mulberrytech dot com
I need to check if the following-sibling has
a child with content <tba> than the current node.
Its a security check to ensure that the input file is
in sorted order (No I won't say why, its too
embarassing).
tba because I'm unsure of the comparison I need.
the check i'm using for identical sibling is
in sorted order, hence the comparison I need
needs to be something like >= or similar,
but I can't get it to work.
So in English I want...
variable name=this-topic select=topic
If the following-sibling::qna/topic has
a 'natural sorted order greater than' value than $this-topic
then process it
else
xsl:message> value-of this-topic value-of following-sibling::qna/topic
</xsl:message
So that the processing bombs out if I screw up, i.e. the input
is not in sorted order.
Please excuse the pidgeon English/pidgeon xsl
my brain is getting scrambled at the moment.
My best attempt to date is
<xsl:for-each select="qna">
<xsl:variable name="this-topic"/>
<xsl:sort select="topic"/>
<xsl:if test="not(following-sibling::qna/topic >= $this-topic)">
<xsl:message terminate="yes">
This <xsl:value-of select="$this-topic"/>
Next <xsl:value-of select="following-sibling::qna/topic"/>
</xsl:message>
</xsl:if>
</xsl:for-each>
TIA DaveP
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list