How to restart the bullet number using <xsl:number

Hi

I have the following xml and xsl fo for it

<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="anoop.xsl"?>
<STUDY>
	<Publisher>O-Rellay
	<Books>
			<Category>Science</Category>
		</Books>
		<Books>
			<Note>Important</Note>
		</Books>
		<Books>
			<Category>Maths</Category>
		</Books>
		<Books>
			<Category>English</Category>
		</Books>
	</Publisher>
	<Publisher>PRISM
	<Books>
			<Category>Social Science</Category>
		</Books>
		<Books>
			<Category>Mathematics</Category>
		</Books>
		<Books>
			<Category>French</Category>
		</Books>
	</Publisher>
</STUDY>
	<xsl:template match="STUDY/Publisher">
		<fo:block display-align="center" font-size="10pt" line-height="200%" text-align="center">
			<xsl:apply-templates/>
		</fo:block>
	</xsl:template>

	<xsl:template match="Publisher/Books">
		<xsl:for-each select="Category | Note">
			<fo:list-block space-before="5pt">
				<fo:list-item>
					<fo:list-item-label end-indent="label-end()">
						<fo:block start-indent="55pt" space-before="10pt">
							<xsl:if test="name() = 'Category'">
								<xsl:number  format="1." count="Publisher/Books/Category" level="multiple"/>
							</xsl:if>
						</fo:block>
					</fo:list-item-label>
					<fo:list-item-body start-indent="body-start()">
						<fo:block start-indent="80pt" wrap-option="wrap" space-before="10pt">
							<xsl:apply-templates/>
						</fo:block>
					</fo:list-item-body>
				</fo:list-item>
			</fo:list-block>
			<br/>
		</xsl:for-each>
	</xsl:template>

I am getting output like this
O-Rellay

  1. Science
    Important
  2. Maths
  3. English
    PRISM
  4. Social Science
  5. Mathematics
  6. French

But I need to get the output like this

O-Rellay

  1. Science
    Important
  2. Maths
  3. English
    PRISM
  4. Social Science
  5. Mathematics
  6. French

Please help in solving this problem.

I thought this looked familliar.

Maybe this thread will help?

XSL:FO - How to decrement the bullet number using fo:list-block

I tried the thread which you reffered. But it is not working in the way I need.
Its working perfectly if the nodes are child of single parent node. If the nodes are childs of different parents node then it is not working.

Can you please help me out in solving this problem.

Finally I found the solution for this problem.

below code is working fine
<xsl:template match=“Publisher/Books/Category”>
<fo:list-block space-before=“5pt”>
<fo:list-item>
<fo:list-item-label end-indent=“label-end()”>
<fo:block start-indent=“55pt” space-before=“10pt”>
<xsl:choose>
<xsl:when test=“name() = ‘Category’”>
<xsl:number format=“1.” count=“Category” level=“any” from=“Publisher”/>
</xsl:when>
</xsl:choose>
</fo:block>
</fo:list-item-label>
<fo:list-item-body start-indent=“body-start()”>
<fo:block start-indent=“80pt” wrap-option=“wrap” space-before=“10pt”>
<xsl:apply-templates/>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</fo:list-block>
</xsl:template>