I have a client that has an existing website of about 100 pages. He wants
those pages translated into 3 different languages. He currently uses a third
party translation source who suggested that a good solution would be to use
xml to hold all the text for the site then use xslt to generate a the pages.
I've attempted to implement this on a page , but the web page loses the
functionality of the webcontrols rendered through xml & xslt. Basically, i
can't add any programming to the code-behind of the page b/c the controls
arent rendered yet. Does anyone know of a vialable to create an .aspx using
xml & xlst that does not lose the code-behind functionality?
societopia.net - 15 Jul 2005 17:55 GMT
If the Web server controls that you need to put on any page are not affected
by the choice of language selected by the user, you might separate the
content from the display by creating a class library that handles the
xml/xslt transformations and that serves them to the Web server controls in
your ASP.NET application webforms.
If the number and layout of Web server controls would be affected by the
page content then you might have to generate the controls dynamically in the
code to wire up the events for each control. For examples on dynamically
creating controls refer to the MSDN library:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbor
icreatingprogrammingwebformscontrols.asp
---
www.societopia.net
> I have a client that has an existing website of about 100 pages. He wants
> those pages translated into 3 different languages. He currently uses a third
[quoted text clipped - 5 lines]
> arent rendered yet. Does anyone know of a vialable to create an .aspx using
> xml & xlst that does not lose the code-behind functionality?
JusPassinThrough - 15 Jul 2005 18:15 GMT
I've done the latter of what you suggested. Except all I did was dynamically
load xml and style it with the xml.Transform class in the code behind. From
there the xml is tranformed and placed on the page. Within the xslt I add
web control code to the page. So the web contols added through xslt and xml
are never instantiated on the page until after the xml is rendered. So I'd
get an error when referrring to those controls from the code behind b/c they
aren't physically on the page until after the xml gets rendered by a browser.
I'm really thinking about trashing the whole idea, yet if i get it to work
it'll be really useful.
> If the Web server controls that you need to put on any page are not affected
> by the choice of language selected by the user, you might separate the
[quoted text clipped - 10 lines]
> ---
> www.societopia.net
societopia.net - 15 Jul 2005 18:48 GMT
As you have realized from your attempt to use xslt, Xslt is a stylesheet
language technology that is meant primarily to create markup (for data
presentation and data transformations), but not to dynamically place controls
on a page and wire up events for them.
---
www.societopia.net
> I've done the latter of what you suggested. Except all I did was dynamically
> load xml and style it with the xml.Transform class in the code behind. From
[quoted text clipped - 21 lines]
> > ---
> > www.societopia.net
Bruce Barker - 15 Jul 2005 22:16 GMT
the xlst approach is pretty incompatible with the asp control model. the asp
control model is to use individual language resource files (those empty
.resx file in you project). you can also use binding to get language
specific values.
-- bruce (sqlwork.com)
>I have a client that has an existing website of about 100 pages. He wants
> those pages translated into 3 different languages. He currently uses a
[quoted text clipped - 9 lines]
> using
> xml & xlst that does not lose the code-behind functionality?