Re: [xsl] switching between multiple languages in XSL

Subject: Re: [xsl] switching between multiple languages in XSL
From: Sara Mitchell <samitchell6@xxxxxxxxx>
Date: Tue, 27 Jun 2006 14:28:31 -0700 (PDT)
Without more information it's very hard to tell
what you need. I'm not sure if this is what you need,
but it sounds similar. 

* I have standard HTML that appears in headers and 
  footers or in navigation in pages of the website
  I build with XSLT. This HTML is kept in XML
  syntax in separate files with known names and
  and locations. The HTML that should be included 
  is wrapped by a <root> element something like this: 

   <tr> <!-- standard header info --></tr>

* in my XSLT, I access these standard configuration
  files and copy in the HTML at appropriate places 
  in the output using the document() function. Like

<xsl:template name="body.header">

This sounds sort of like what you're talking about
with the difference that you want to select different
configuration files based on an attribute or element
value in your source XML file. This could be done
as simply as: 

<xsl:if test="flag='EN'">
 <xsl:call-template name="body.header">
  <xsl:with-param name="config-doc"

and the addition of a "config-doc" parameter in the
templates that open the XML configuration docs and
in their content. 

Sara Mitchell
--- Jason Viers <bean@xxxxxxxxxxxx> wrote:

> We're transforming a XML file to HTML via XSL, and
> we'd like the XSL to 
> be usable across multiple languages.  The XML file
> being transformed 
> does _not_ have the text we'd like to select
> between, just an indication 
> as to what language should be used.  There are
> things like static 
> headers & footers we'd like to switch between based
> on the flag in the XML.
> We'd like to have the language-specific sections in
> their own files, so 
> the language teams can work on them independently of
> the main XSL file.  
> We couldn't find a way to do this using <xsl:import>
> as we can't have a 
> certain one included based on a condition,a nd we
> can't really "select" 
> out of those, as they're not the source document.
> Has anyone tried something similar, or have any
> advice how to approach this?
> Thanks
> Jason

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

Current Thread