[Home] [By Thread] [By Date] [Recent Entries]
At 2013-09-05 18:51 +0000, Costello, Roger L. wrote:
The value of this variable is a sequence of strings: Remember that an "AND" is the same as "not( OR )" (DeMorgan's Law) and XSLT 2 has a built-in "OR" with the comparison of a singleton to a sequence. Thus, I hope the code below helps. . . . . . . . . Ken t:\ftemp>xslt2 roger.xsl roger.xsl For: Sally Sally Beth Beth Mary Mary: true For: Sally Beth Beth Beth Mary Mary: false t:\ftemp>type roger.xsl
<?xml version="1.0" encoding="US-ASCII"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="2.0"><xsl:output method="text"/> <xsl:template match="/">
<xsl:call-template name="checkPairs">
<xsl:with-param name="checkPairs"
select="('Sally', 'Sally', 'Beth', 'Beth', 'Mary', 'Mary')"
as="xs:string*"/>
</xsl:call-template>
<xsl:call-template name="checkPairs">
<xsl:with-param name="checkPairs"
select="('Sally', 'Beth', 'Beth', 'Beth', 'Mary', 'Mary')"
as="xs:string*"/>
</xsl:call-template>
</xsl:template><xsl:template name="checkPairs">
<xsl:param name="checkPairs" as="xs:string*"/>
<xsl:text>For: </xsl:text>
<xsl:value-of select="$checkPairs"/>
<xsl:text>: </xsl:text>
<xsl:value-of
select="not( false() =
( for $n in 1 to count($checkPairs) div 2
return ( $checkPairs[$n*2-1]=$checkPairs[$n*2] ) ) )"/>
<xsl:text>
</xsl:text>
</xsl:template></xsl:stylesheet> t:\ftemp> -- Public XSLT, XSL-FO, and UBL classes in the Netherlands Oct 2013 | Public XSLT, XSL-FO, UBL and code list classes in Australia Oct 2013 | Contact us for world-wide XML consulting and instructor-led training | Free 5-hour lecture: http://www.CraneSoftwrights.com/links/udemy.htm | Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ | G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx | Google+ profile: https://plus.google.com/116832879756988317389/about | Legal business disclaimers: http://www.CraneSoftwrights.com/legal |
|

Cart



