[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Constructing a sequence: numbers are added up rep
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:f="data:,f" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xsl:function name="f:seq" as="xs:integer*"> <xsl:param name="s" as="xs:integer*"/> <xsl:param name="t" as="xs:integer"/> <xsl:param name="p" as="xs:integer"/> <xsl:variable name="n" select="$s[1]"/> <xsl:variable name="m" select="if($n=(104,118)) then 0 else if ($n=122) then -1 else 1"/> <xsl:sequence select="if(exists($s)) then $p + $t, f:seq($s[position()!=1],$t + $m, $p+1) else ()"/> </xsl:function> </xsl:stylesheet> $ saxon9 -it m sums.xsl <?xml version="1.0" encoding="UTF-8"?> --- 1 3 5 7 9 11 12 14 15 17 18 20 --- David ________________________________________________________________________ The Numerical Algorithms Group Ltd is a company registered in England and Wales with company number 1249803. The registered office is: Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom. This e-mail has been scanned for all viruses by Star. The service is powered by MessageLabs. ________________________________________________________________________
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|