Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 20th, 2005, 09:40 AM
indyjason79@yahoo.com
Guest
 
Posts: n/a
Default Using XML in multilingual website pages

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

  #2  
Old July 20th, 2005, 09:40 AM
Peter Flynn
Guest
 
Posts: n/a
Default Re: Using XML in multilingual website pages

indyjason79@yahoo.com wrote:
[color=blue]
> 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.[/color]

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"
  #3  
Old July 20th, 2005, 09:40 AM
Shmuel (Seymour J.) Metz
Guest
 
Posts: n/a
Default Re: Using XML in multilingual website pages

In <1117211137.262237.289340@z14g2000cwz.googlegroups .com>, on
05/27/2005
at 09:25 AM, indyjason79@yahoo.com said:
[color=blue]
>Subject: Using XML in multilingual website pages[/color]

And yet you have
[color=blue]
>charset="Windows-1252"[/color]

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 spamtrap@library.lspace.org

 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles