Using XML in multilingual website pages

I

indyjason79

I'm in the process of creating a huge Global Website for a large
company. I was wondering how I could separate the code from the text
and I'm starting to look into XML for this. I was thinking I could code
the pages in ColdFusion, and store all the content text in XML
documents. My question is: how do you populate the HTML pages with the
text stored in the XML documents? I've tested the following method, but
I think it would cause a performance issue. I was thinking I could just
pull the XML text and store it in a CF structure, then populate the
HTML using CFOUTPUT tags on the structure. I'm sure there is an easier
way to do this, and that's what I'm looking for. Any help would be
appreciated!

Ex.

XML Document:

<?xml version="1.0" encoding="UTF-8"?>
<content xml:lang="en" engname="English" langname="English"
charset="Windows-1252">
<title>[Home] 7-7000 Online</title>
<lang>en</lang>
<charset>Windows-1252</charset>
<langname>English</langname>
<welcome>Welcome</welcome>
<footer_1_0>This Page Last Updated</footer_1_0>
</content>


CF/HTML Document:

<cfmodule template="custom_tags/xmlParser.cfm">

<cffile action="read"
file="#APPLICATION.properties.cf_path#/#SESSION.user.language##CGI.script_name#.xml"
variable="xml">

<cflock scope="session" type="exclusive" timeout="10">
<cfset SESSION.language = StructNew()>
<cfset SESSION.language = xml2struct(xml)>
</cflock>

<html>
<title><cfoutput>#SESSION.language.content.title#</cfoutput></title>
....

Thanks,
Jason
 
P

Peter Flynn

I'm in the process of creating a huge Global Website for a large
company. I was wondering how I could separate the code from the text
and I'm starting to look into XML for this. I was thinking I could code
the pages in ColdFusion, and store all the content text in XML
documents. My question is: how do you populate the HTML pages with the
text stored in the XML documents? I've tested the following method, but
I think it would cause a performance issue.

There are some performance issues, variously addressed by combinations of
caching and pipelining. Three example applications of real-time XML-to-HTML
conversion servers are Cocoon, AxKit, and PropelX. Alternatively, if the
information does not change rapidly, make static transformations using (eg)
Saxon on a batched periodic basis.

///Peter
 
S

Shmuel (Seymour J.) Metz

In <[email protected]>, on
05/27/2005
at 09:25 AM, (e-mail address removed) said:
Subject: Using XML in multilingual website pages

And yet you have
charset="Windows-1252"

which is a proprietary character set. Surely you should be using UTF-8
unless you can restrict the languages that you wish to support.

--
Shmuel (Seymour J.) Metz, SysProg and JOAT <http://patriot.net/~shmuel>

Unsolicited bulk E-mail subject to legal action. I reserve the
right to publicly post or ridicule any abusive E-mail. Reply to
domain Patriot dot net user shmuel+news to contact me. Do not
reply to (e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top