xsl-list
[Top] [All Lists]

Re: lang function in a named template

2004-10-17 13:33:17
Marc Franquesa wrote:

This stylesheet must be indepedent of the XML source, therefore will
be a named template or a match="/" template. The problem in both cases
is that will be no context node to parse the xml:lang attribute.

Marc,

All you need is setting the context to the root element (instead of the root node).
In page.xsl, template match="/", if you replace

                       <xsl:call-template name="PageFoot" />

with

                       <xsl:for-each select="/*">
                           <xsl:call-template name="PageFoot" />
                       </xsl:for-each>

the <when test="lang('ca')"> branch will be reached.

(or, if you prefer, put the <xsl:for-each select="/*">
around the <xsl:choose> in the PageFoot template)

HTH,
Anton


<Prev in Thread] Current Thread [Next in Thread>