[Home] [By Thread] [By Date] [Recent Entries]
Well, many things...
First, using named templates is often a bad practise. You'd better use templates with patterns, it makes the stylesheet more readable, more maintenable, and it allows to process source in many steps. If you want modify your generated table, the best thing to do is to reprocess it : <xsl:mode name="tableModif" on-no-match="shallow-copy"/> <xsl:template....> B <xsl:variable name="firstStep" as="element(table)"> B B B <table border="0" cellspacing="0"> B B B B B <!-- your whole table code here --> B B B </table> B </xsl:variable> B <xsl:apply-templates select="$firstStep" mode="tableModif"/> </xsl:template> <xsl:template match="th" mode="tableModif"> B <xsl:copy> B B B <xsl:attribute name="style">font-weight: bold;</xsl:attribute> B B B <xsl:apply-templates select="node()|@*"/> B </xsl:copy> </xsl:template> Here two things : when table element is generated, it is kept into a variable, and does not do to output. Then, I re-process the variable (that contains a table element) in a user-defined mode, call tableModif ; in that mode, when there is no specific template that match an item, item is copied. And I declare a template that is activated for each th element in mode tableModif, and this templateB copies the template element, adds a style attribute, and continue to process each attributes and each child elements of th - there are copied, because of xsl:mode definition, and because there is no specific tempalte rule. Hope this helps, Christophe Le 04/03/2020 C 18:49, Kammering, Raimund raimund.kammering@xxxxxxx a C)critB : Hello,
|

Cart



