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

  • Home
  • SEARCH
  • 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 3396460
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T04:24:38+00:00 2026-05-18T04:24:38+00:00

We are building a system that gets XML data from a database, uses XSLT

  • 0

We are building a system that gets XML data from a database, uses XSLT to transform it to XHTML and at the same time use an external XML file to retrieve culture-specific labels (translations for our labels).

Short Question
Does the translation/culture-specific system seem logical ? Efficient ?

Any alternative concepts are welcome (in this specific context)


Detailed Question

XML data

<page id="55" objecttype="ChristianOrthodoxMonument">
 <field name="uniquename">some unique name here</field>
        .. multiple field elements here ..
</page>

XML culture-labels

<ChristianOrthodoxMonument>
 <uniquename culture-1="Ονομασία" culture-2="Unique name" />
 <birthdate culture-1="Ημ/νία γέννησης" culture-2="Date of birth" />
</ChristianOrthodoxMonument>

now in XSLT i pass the cultureid parameter to be used for the mapping to the labels.

XSLT (example snippet)

<xsl:param name="cultureid" select="1" />
<xsl:variable name="objecttype" select="/page/@objecttype" />

and to map to the external file which is included with

<xsl:variable name="culture" select="document('cultural-labels.xml')" />

i created a pseudo dynamic xpath

<xsl:template name="translate">
 <xsl:variable name="nodename" select="@name" />
 <xsl:value-of select="$culture/*[name()=$objecttype]/*[name()=$nodename]/@*[name()=concat('culture-',$cultureid)]" />
</xsl:template>

which i call whenever i want to get the label for a field.

Question A : is this xpath efficient or overkill ? overcomplicated ?
Question B : does this model seem right or am i missing something vital that will prove to be an obstacle in the future ?
Question C : Is there any theory/example on similar mapping techniques to external XML files ?


2nd Update with composite key usage

key

<xsl:key name="find-node" match="*" use="concat(name(..),'!',name())"  />

lookup

<xsl:template name="lookup-label">
<xsl:param name="objecttype" />
<xsl:variable name="nodename" select="@name" />
<xsl:for-each select="$culture">
    <xsl:value-of select="key('find-node',concat($objecttype,'!',$nodename))/@*[name()=$culturefield]" />
</xsl:for-each>
</xsl:template>

is this an improvement ?

  • 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-18T04:24:39+00:00Added an answer on May 18, 2026 at 4:24 am

    Short Question Does the translation/culture-specific system
    seem logical ?

    Yes.

    Efficient ?

    It can be efficient — not exactly your implementation.

    i created a pseudo dynamic xpath

    <xsl:template name="translate"> 
     <xsl:variable name="nodename" select="@name" /> 
     <xsl:value-of select=
      "$culture/*[name()=$objecttype]
                   /*[name()=$nodename]
                        /@*[name()=concat('culture-',$cultureid)]"
    

    />

    which i call whenever i want to get
    the label for a field.

    Question A : is this xpath efficient or overkill ?

    No, it isn’t efficient, because the whole XML document will be traversed many times to find specific objecttype nodes.

    overcomplicated ?

    No.

    Question B : does this model seem right or am i missing something vital
    that will prove to be an obstacle in
    the future ?

    The model is generally OK.

    Question C : Is there any theory/example on similar mapping
    techniques to external XML files ?

    There are many examples of efficient lookup based on keys — even at SO. Also see this one.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a project that uses the JVCL plugin system, which relies on runtime
We're currently building a system that abstracts all kinds of technical details about web
I am building a multithreaded system that works like this: While there are entities:
We are currently thinking of building a cache-system to hold data pulled out of
I am building a system for distributing packages (.zip archives) created by different organizations.
In a .net system I'm building, there is a need for automated e-mail notifications.
I'm building a with-source system which I am giving out on the 'net for
Platform Builder is a tool for building a Windows CE Operating system on your
I'm currently tinkering at an OpenBSD system with a view to building myself a
So we're building a locally(at customers site) hosted, custom point of sale system, nothing

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.