Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1060787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:22:49+00:00 2026-05-16T18:22:49+00:00

I doing the right transformations to develop a multilingual website. All the text of

  • 0

I doing the right transformations to develop a multilingual website. All the text of this website needs to be taken from an XML file because the output of the site will be the processed file.

This are the basic files, index.xml:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="xsl/index.xsl"?>
<page>
    <entry>
        <id>12</id>
        <value>img/12.jpg</value>
    </entry>
    <entry>
        <id>13</id>
        <value>img/13.jpg</value>
    </entry>
</page>

This entries are unique so they didn’t need to be translated. My index.xsl:

<?xml version="1.0" encoding="UTF-8"?>   
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <!-- I'm including a language file, but I've various language files that will be stored in different folders -->
    <xsl:param name="menu" select="document('../lang/index.xml')" />

    <xsl:template match="/">
        <html>
            <xsl:attribute name="lang"><!-- name of the lang --></xsl:attribute>

            <head></head>

            <body>
                <ul id="menu">
                    <xsl:for-each select="language/menu">
                        <li><xsl:value-of select="." /></li>
                    </xsl:for-each>
                </ul>

                <!-- this is not important, is an example -->
                <xsl:for-each select="page/entry">
                    <xsl:value-of select="id" />
                </xsl:for-each>
            </body>
        </html>
    </xsl:template>
</xsl:stylesheet>

I include ../lang/index.xml which contains all the words in some language, for example English. I need this site in 3 different languages that can be stored like:

/lang/en/index.xml

<language>
    <menu>Home</menu>
    <menu>Images</menu>
</language>

/lang/es/index.xml

<language>
    <menu>Inicio</menu>
    <menu>Imágenes</menu>
</language>

/lang/fr/index.xml

<language>
    <menu>Maison</menu>
    <menu>Images</menu>
</language>

My question is how I can manage this. I’ve no option to change that, because I’m not allowed to do a specific index.xsl file for each language.

Thank you in advance and sorry for school English.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T18:22:50+00:00Added an answer on May 16, 2026 at 6:22 pm

    This stylesheet:

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:output method="xml"/>
        <xsl:param name="pLang" select="'es'"/>
        <xsl:param name="pMenu" 
                   select="document(concat('../lang/',$pLang,'/index.xml'),/)"/>
        <xsl:template match="/">
            <html lang="{$pLang}">
                <head></head>
                <body>
                    <ul id="menu">
                        <xsl:apply-templates select="$pMenu/*"/>
                    </ul>
                    <xsl:apply-templates select="page/entry"/>
                </body>
            </html>
        </xsl:template>
        <xsl:template match="language/menu">
            <li>
                <xsl:value-of select="." />
            </li>
        </xsl:template>
        <xsl:template match="entry">
            <img id="{id}" src="{value}"/>
        </xsl:template>
    </xsl:stylesheet>
    

    Output:

    <html lang="es">
        <head></head>
        <body>
            <ul id="menu">
                <li>Inicio</li>
                <li>Imágenes</li>
            </ul>
            <img id="12" src="img/12.jpg" />
            <img id="13" src="img/13.jpg" />
        </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.