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

lang function in a named template

Subject: lang function in a named template
From: Marc Franquesa <marc.franquesa@xxxxxxxxx>
Date: Sat, 16 Oct 2004 19:02:28 +0200
xsl lang
Hi, I'm new to the list and don't a good english-speaker, sorry.

I have a little problem with the xml:lang attribute, I belive that I
found the cause
but not sure, so...

I set xml:lang attribute in the root element (faq) of XML file
(xfaq.xml), this document uses the xfaq.xsl stylesheet.

The xfaq.xsl stylesheet imports the page.xsl stylesheet, and the only
template in xfaq.xsl is the '<xsl:template match="faq">' template (the
one that matches the root element 'faq' with the xml:lang attribute).

In the 'page.xsl' stylesheet there is a template that matches '/' and
inside it I call
the named template 'PageFoot' which contains this code:

<xsl:choose>
	<xsl:when test="lang(ca)">Catal`</xsl:when>
	<xsl:when test="lang(es)">Espaqol</xsl:when>
	<xsl:when test="lang(en)">English</xsl:when>
	<xsl:otherwise>No xml:lang</xsl:otherwise>
</xsl:choose>

This code doesn't work: displays nothing (despite the otherwise).

First, I suspected that the problem was the named template, I thinked
that in a named template no 'context-node' exist, but later consulting
some FAQs and doc I see examples doing it.

I think the problem can be that the calling template matches '/' and
not 'faq', then no xml:lang attribute has been defined.

?Someone knows exactly which the cause is?
Any suggestion will be accepted.

--
'Pero existe la voluntad, "El Futuro" es inherentemente plural'
All tomorrow parties - William Gibson
http://www.l3jane.net
Vic - Catalonia

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.