By the generator we assume a function that produces an infinitive output sequence for a particular input.
That's a rather theoretical question, as xslt does not allow infinitive sequence, but look at the example:
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:t="http://www.nesterovsky-bros.com/xslt" exclude-result-prefixes="xs t"> <xsl:template match="/"> <xsl:variable name="value" as="xs:string" select="'10100101'"/> <xsl:variable name="values" as="xs:integer+" select="t:generate(1)"/> <!--<xsl:variable name="values" as="xs:integer+"> <xsl:call-template name="t:generate"> <xsl:with-param name="value" select="1"/> </xsl:call-template> </xsl:variable>--> <xsl:variable name="integer" as="xs:integer" select=" sum ( for $index in 1 to string-length($value) return $values[$index][substring($value, $index, 1) = '1'] )"/> <xsl:message select="$integer"/> </xsl:template> <xsl:function name="t:generate" as="xs:integer*"> <xsl:param name="value" as="xs:integer"/> <xsl:sequence select="$value"/> <xsl:sequence select="t:generate($value * 2)"/> </xsl:function> <!--<xsl:template name="t:generate" as="xs:integer*"> <xsl:param name="value" as="xs:integer"/> <xsl:sequence select="$value"/> <xsl:call-template name="t:generate"> <xsl:with-param name="value" select="$value * 2"/> </xsl:call-template> </xsl:template>--> </xsl:stylesheet>
Here the logic uses such a generator and decides by itself where to break.
Should such code be valid?
From the algorithmic perspective example would better to work, as separation of generator logic and its use are two different things.
Remember Me
a@href@title, b, blockquote@cite, em, i, strike, strong, sub, super, u