|
Subject: Re: [xsl] Numbering new nodes using consecutive integers From: Michael Ludwig <mlu@xxxxxxxxxxxxx> Date: Fri, 27 Mar 2009 19:05:12 +0100 |
<xsl:number> should be used for adding text to the result tree and only used in variables as a last resort.
Now it would be perfect if the numbering was done as a strict sequence of consecutive integers, meaning 1,2,3 instead of, say, 1,3,5.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:attribute name="no"
select="position() (:within this group:) +
(:count of subgroups within previous groups:)
sum( for $g1 in ../preceding-sibling::G1 return
((count($g1/M)-1) idiv $M-per-G2 + 1) )"/>
(I made a note to remember using XPath 2.0 comments to make complex expressions less cryptic.)
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] Numbering new nodes using, G. Ken Holman | Thread | Re: [xsl] Numbering new nodes using, Wendell Piez |
| RE: [xsl] length of string from a s, Michael Kay | Date | Re: [xsl] Numbering new nodes using, Michael Ludwig |
| Month |