This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

sequentially counting in XSL


Hi,

It's been a while since I started using XSL - at this moment I have written a tool that scans Java source files, transforms them into XML, performs operations on them and then transforms the output back into Java code (automatically pretty-printed) using XSL stylesheets.

I encountered a (small?) problem can be explained with the following piece of XML:

<UnmodifiedClassDeclaration>
   <FieldDeclaration/>
   <MethodDeclaration/>
   <ConstructorDeclaration/>
   <MethodDeclaration/>
</UnmodifiedClassDeclaration>

When I want to generate numbered testcases for the methods and use <xsl:number value="position()"/>, the testcases are not sequentially numbered. I've tried several other possibilities like <xsl:number count="MethodDeclaration"/> etc, but I can't get it work right.

Does anyone know the solution?

It would be nice if XSL had a function like "iterator()" that is set to 1 when an XSL sheet is loaded and each time it's called it returns its value, after which it is immediately incremented by 1.

Besides, I noticed that the Oracle XSL processor counts empty elements as if there were two - a start and an end element. This is not the case with the XSL editor of IBM.

Hugo De Groot
X punt X b.v. IT Services



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]