Subject: alpha comparison From: "Dave Pawson" <dave.pawson@xxxxxxxxxx> Date: Sun, 9 Apr 2000 18:40:59 +0100 |
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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: efficient filtering of XML file, Dave Pawson | Thread | RE: alpha comparison, Kay Michael |
RE: efficient filtering of XML file, Dave Pawson | Date | Creating an xml doc from another xm, Matthew Cordes |
Month |