Input Dita file
If any topic has p/@outputclass="kingbreak", we want to create footer page number with horizontal, I tried with xsl:number/ but it is picking disorder page number, Please help
<?xml version="1.0" encoding="utf-8"?>
<dit xmlns:dita-ot="http://dita-ot.sourceforge.net/ns/201007/dita-ot">
<topic>
<title/>
<body>
<p>content here</p>
<p>content here <ph/>content here</p>
<p outputclass="kingbreak"/>
</body>
</topic>
<topic>
<title>SELF title</title>
<body>
<p>body content</p>
</body>
<topic>
<title>content here</title>
<body>
<p>
<b>content here</b>
</p>
</body>
<topic>
<title>content here</title>
<body>
<section>
<p>contenet here</p>
<p outputclass="kingbreak"/>
</section>
</body>
</topic>
<topic>
<title>content here</title>
<body>
<section>
<p>content here</p>
<p outputclass="kingbreak"/>
</section>
</body>
</topic>
<topic>
<title>title content here</title>
<body>
<p>content here</p>
<p outputclass="kingbreak"/>
</body>
</topic>
<topic>
<title>content here</title>
<body>
<section>
<p>content here</p>
<p outputclass="kingbreak"/>
</section>
</body>
</topic>
</topic>
</topic>
</dit>
XSLT I tried with below xslt, it is generating random page number
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
version="2.0">
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="p[contains(@outputclass, 'kingbreak')]">
<xsl:number/>
<hr style="border-top:1.5pt solid #000000;" />
</xsl:template>
<xsl:stylesheet/>
Please help on this, thanks in advance
contenet here
content here