[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: lang function in a named template

Subject: Re: lang function in a named template
From: Anton Triest <anton@xxxxxxxx>
Date: Sun, 17 Oct 2004 22:33:17 +0200
r.e. lang
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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.