You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Torkild Ulvøy Resheim <tr...@online.no> on 2001/01/26 15:21:32 UTC

Heeding language attributes in stylesheets?

I'm transforming an XML document using Xalan and a multi-language stylesheet. Is there any way to make the translation only use elements that belongs to the default (current) locale or don't have any language specified? For instance:

  <xsl:template match="catalog-header">
    <h1 xml:lang="no">Prisliste for <xsl:value-of select="company-name"/></h1>
    <h1 xml:lang="en">Pricelist for <xsl:value-of select="company-name"/></h1>
    <h2><xsl:value-of select="comment"></h2>
  </xsl:template>

If the locale is "en_US" you would only want to use the <h1> element that has the lang attribute set to "en". While the <h2> element would show either way.
--
  Torkild Ulvøy Resheim, Sofware Engineer at Emma EDB AS     ((
  Work: http://www.emmaedb.no/, torkild.resheim@emmaedb.no    ))  
  Private homepage: http://www.tihlde.org/~torkildr         |----|_
  <math>2+2=5 for sufficiently large values of 2</math>     |    | )
                                                            |____|´