Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - help with xsl:number [Thread Next] Re: help with xsl:numberTo: NULL Date: 11/2/2005 1:39:00 PM I figured it out myself, here is the resulting XSL: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <xsl:apply-templates/> </xsl:template> <xsl:template match="figure"> Figure <xsl:number format="1" level="single" count="chapter"/>.<xsl:number format="1" level="any" count="figure" from="chapter"/> </xsl:template> </xsl:stylesheet> "news.microsoft.com" <djo267 at hotmail dot com> wrote in message news:e8cE%23u93FHA.3876@T...... > Hi everyone, I'm trying to get the xsl:number element to work and am > having some issues. I'm not sure if what I'm trying to do is even > supported. I have figure elements at various levels underneath chapter > elements and am trying to number them sequentially by chapter.figure > number. The XML/XSL/CURRENT OUTPUT/DESIRED OUTPUT I have shown below is > what I have so far. > any help is appreciated. > thanks, dan > > CURRENT OUTPUT: > 1.1 > 1.2 > 1.1 > 1.1 > 2.1 > 2.1 > > DESIRED OUTPUT: > 1.1 > 1.2 > 1.3 > 1.4 > 2.1 > 2.2 > > XSL: > <xsl:stylesheet version="1.0" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> > <xsl:template match="/"> > <xsl:apply-templates/> > </xsl:template> > > <xsl:template match="figure"> > Figure <xsl:number format="1.1" level="multiple" count="chapter | > figure"/> > </xsl:template> > > </xsl:stylesheet> > > > XML: > <root> > <chapter> > <figure/> > <figure/> > <section> > <para> > <figure/> > </para> > </section> > <section> > <subsection> > <para> > <figure/> > </para> > </subsection> > </section> > </chapter> > <chapter> > <section> > <para> > <figure/> > </para> > </section> > <section> > <subsection> > <para> > <figure/> > </para> > </subsection> > </section> > </chapter> > </root> > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
