[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] lang function in a named template


Subject: Re: [xsl] lang function in a named template
From: Marc Franquesa <marc.franquesa@xxxxxxxxx>
Date: Sun, 17 Oct 2004 17:03:01 +0200

On Sat, 16 Oct 2004 19:25:55 +0100, Michael Kay <mike@xxxxxxxxxxxx> wrote:

> > You need to say lang('ca') not lang(ca)

Stupid error!. Thanks for your indication.

> And you need to call it when an element (not the root node) is the context
> node.

I suspected it

> But if the otherwise branch isn't being called, then neither of these errors
> is enough to explain the problem. Need to see more of your code.

Don't bother about the otherwise not being called. I 'm using libxslt
for the test and I realised that in some cases doesn't work as
expected while Xalan or Transformiix give a diferent (and correct)
result tree.

Although I think that I need a XSLT pattern to do the work, but I'm
novice and need help finding which is the best from to achieve it. If
someone wants to help me I will be very grateful. I try to explain me
better, again sorry for the grammar. You can see the documents
involved in http://www.l3jane.net/working/testing/

What I want to do is have a 'page.xsl' stylesheet generic for the
site, only modified when the global site style changes. Basically this
XSLT will output the 'html', 'head', and 'body' nodes of the HTML
result tree. Inside the body makes a '<xsl:apply-templates />'  to
transform the real contents of the XML which must have a especific
XSLT to parse _only_ the information (matching the root node for
example).  I need to know the xml:lang attribute to output the headers
and titles in the correct language.

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.

If someone knows a better way to do it or can give me some url,
tutorial or doc ...

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


Current Thread
Keywords