[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Finding the position of an ancestor
One brute force method would be to have a template that matches step and
then in this template call another template that matches for chunk and
pass down the value of the position of step to this template.
eg <xsl:template match="Step"> <xsl:apply-templates select="descendant::Chunk[@type='FieldRef']"> <xsl:with-param name="pos" select="position()"/> </xsl:apply-templates> </xsl:template> <xsl:emplate match="Chunk"> <xsl:param name="pos"/> <!-- Field processing goes here --> </xsl:template> Apologies if syntax is incorrect it has been a while since I have done XSLT and I have never used descendant, but hopefully you get at what I am saying. I have done something similar in the past and this was the only way I could do it. If anyone knows of a better way, I would be grateful to find out. Maybe you can find a way of making this more elegant by going back to the step rather than forward to the chunk and getting the position that way (ie, create a template that gets and prints the position of a step) Nicholas Orr wrote: I was wondering if someone can help me work out a position issue I'm struggling with.
|
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
|