Re: find position of first occurrence in a node set
I feel like this is a rather elementary question and a bit embarrased to ask so I'm sending this to you off-list, I hope you don't mind.
Two questions in regards to your answer...
1) I'm not sure why you have the <xsl:template> instruction there other than to make sure the stylsheet you tested with is a proper one. For my use I am doing this:
<xsl:variable name="current_transaction_set" >
<xsl:copy-of select="current-group()" />
This gives me the correct value I'm looking for from the <xsl:number> instruction. Am I missing something by not using the template instruction? Or is this just a different solution to the same problem (is one better than another)?
2) As you can see I'm having to copy in the current-group() to a variable before I can apply the <xsl:number> instruction. I tried this:
But the value I get in return is wrong. It seems to be counting the attributes as well as the <segment> elements. I really don't understand why that is. Would you please explain that to me? Is there a way to tell the "select" attribute of the <xsl:number> instruction to ignore the attributes of the <segement> elements so I don't have to worry about the $current_transaction_set variable?
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format