This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

alpha comparison


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 &gt;= $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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]