<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
 <xsl:apply-templates select="/books/book[1]"/>
</xsl:template>


<xsl:template match="book">
 <xsl:param name="counter" select="0"/>

 <xsl:variable name="localCounter">
  <xsl:if test="paperback='true'">1</xsl:if>
  <xsl:if test="english='true'">1</xsl:if>
  <xsl:if test="inPrint='true'">1</xsl:if>
 </xsl:variable>

 <xsl:variable name="total" select="$counter + string-length($localCounter)"/>

 <xsl:apply-templates select="following-sibling::book[1]">
  <xsl:with-param name="counter" select="$total"/>
 </xsl:apply-templates>

 <xsl:if test="not(following-sibling::book[1])">
  <xsl:value-of select="$total"/>
 </xsl:if>

</xsl:template>

</xsl:stylesheet><!-- Stylus Studio meta-information - (c) 2004-2005. Progress Software Corporation. All rights reserved.
<metaInformation>
<scenarios ><scenario default="yes" name="paperback.xml" userelativepaths="yes" externalpreview="no" url="paperback.xml" htmlbaseurl="" outputurl="" processortype="msxmldotnet" useresolver="no" profilemode="0" profiledepth="" profilelength="" urlprofilexml="" commandline="" additionalpath="" additionalclasspath="" postprocessortype="none" postprocesscommandline="" postprocessadditionalpath="" postprocessgeneratedext="" validateoutput="no" validator="internal" customvalidator=""/></scenarios><MapperMetaTag><MapperInfo srcSchemaPathIsRelative="yes" srcSchemaInterpretAsXML="no" destSchemaPath="" destSchemaRoot="" destSchemaPathIsRelative="yes" destSchemaInterpretAsXML="no" ><SourceSchema srcSchemaPath="paperback.xml" srcSchemaRoot="books" AssociatedInstance="" loaderFunction="document" loaderFunctionUsesURI="no"/></MapperInfo><MapperBlockPosition><template match="/"></template><template match="book"></template></MapperBlockPosition><TemplateContext></TemplateContext><MapperFilter side="source"></MapperFilter></MapperMetaTag>
</metaInformation>
-->