[Home] [By Thread] [By Date] [Recent Entries]
Hi Bruno,
Then adjust the previous solution output the number element and put as value the previous word_number value if any, otherwise 'sg.'. <?xml version="1.0"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes"/> <xsl:template match="something"> <something-else> <xsl:for-each-group select="*" group-ending-with="word_form"> <form><xsl:apply-templates select="current-group()"/></form> </xsl:for-each-group> </something-else> </xsl:template> <xsl:template match="word_case"> <case><xsl:value-of select="."/></case> </xsl:template> <xsl:template match="word_form"> <form><xsl:value-of select="."/></form> <number><xsl:value-of select="(preceding-sibling::word_number[1], 'sg.')[1]"></xsl:value-of></number> </xsl:template> </xsl:stylesheet> Best Regards, George --------------------------------------------------------------------- George Cristian Bina - http://aboutxml.blogspot.com/ <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com Bruno Nahod wrote: Dear George (and anybody who red my post) so sorry for the mistake off course the last <number/> should be "pl." not "sg." I have check it twice and steel managed to miss it. Some extra info: the singular is implied in export xml and the beginning of plural is announced with <word_number>pl.</word_number> I hope this helps. I do apologize once again.
|

Cart



