![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: position() question [Thread Next] Re: position() questionTo: NULL Date: 2/1/2007 8:38:00 PM > I am not sure what you mean by "sequence number". Is that the number of > nodes before the current in the document tree? The number of preceding > sibling nodes? The number of preceding elements? Generally, count(...) > is what you are looking for, for example > > count(preceding-sibling::*) > I tried it's not working. It print 1, 2, 3 for count(preceding::tksum)+1 then no number afterwards. fee and tksum are on the same level. There are 5 tksum but only 3 meet the condition. But I want to print number on every fee. Every fee has a id match the id of tksum. Since I have to scan all fee item for each tksum, I didn't find an easy way to do it. Here is part of the xslt file. Basically I want to print all fee items with >0 charge. But I want to keep linenumber as a continous sequence. <xsl:for-each select="/ledesxml/client/invoice/matter/tksum[tk_hours>0]"> <xsl:variable name="TimeKeep"> <xsl:value-of select="tk_id"/> </xsl:variable> <xsl:if test="/ledesxml/client/invoice/matter/fee[tk_id/. = $TimeKeep]"> Linenumber - <xsl:value-of select="count(preceding::tksum)+1"/> <xsl:call-template name="TKeepDetail" > <xsl:with-param name="TKeepInfo" select="tk_id"/> </xsl:call-template> </xsl:if> </xsl:for-each> | ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
