views:

74

answers:

0

I have built a couple of multilingual sites which output labels from an XML file - the XML file used is determined by a cookie (ENG, NL, ESP etc) and looks like this:

<resources>
     <coming>Coming soon</coming>
</resources>

I've been using a script which, within a function, takes each XML child and makes a variable from it's value:

  for (child in xml.resources) {
     variables[language][child] = xml.resources[child].XmlText;
  }

  return variables[language];

I then have to just output #lang.coming# and this gives me "Coming soon". I want to know how to do this from a database query. Assuming I have my query and each record contains a unique identifier (coming) and a value (Coming soon) how do I put it into a variable allowing me to output #lang.identifier#

Thanks in advance!