By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,078 Members | 1,846 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,078 IT Pros & Developers. It's quick & easy.

Using XML in multilingual website pages

P: n/a
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

Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
in*********@yahoo.com wrote:
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
--
sudo sh -c "cd /;/bin/rm -rf `which killall kill ps shutdown mount gdb` *
&;top"
Jul 20 '05 #2

P: n/a
In <11**********************@z14g2000cwz.googlegroups .com>, on
05/27/2005
at 09:25 AM, in*********@yahoo.com 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 sp******@library.lspace.org

Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.