Buy Viagra Soft

order viagra soft
by Nathan Tippy

XSLT XML i18n

There appear to be three primary ways of adding internationalization support to an XML based web application. There are many variations on these solutions but they all fall into one of these three groups. Simple LANG attributes This solution does not rely as much on XSLT as the others and it can be combined with them for a more elegant design. The LANG attribute is recognized by browsers that support multiple languages. The appropriate element will be displayed based on the desired locale. When you look at the html there should be duplicate elements, one for each language. The final HTML will be x times larger based on the number of languages supported it will not scale well if a large number of languages need to be supported. If simplicity of design is your goal this may be the best solution with the provision that you only add 2 or 3 languages. Document lookup This is the more traditional XML solution. We have one or more xml documents that contain all the foreign language words under known elements. This document will be loaded and assigned to a variable somewhere near the top of the XSLT pages. Each time we need a label its looked up from this document using xpath. None of the final text will be visible to developers working on the XSLT pages. This may make it more difficult to debug problems but this can be easily overcome with good naming conventions. The insertion of these xpath references will add to the complexity of each page but the final product will be a clean page dynamically built for one language. The transform performance of this solution will be worse than the others because of the large number of xpath lookups. Variable import This is a creative solution that makes use of XSTL variables for simple replacement of foreign language text. This solution requires all the XSLT pages to use variables instead of the actual text. Instead of using these XSLT pages directly the transform engine will use another page like MYPAGE_en.xsl which will import the main application page and then define all the variables that will be used. There will be one of these pages as an entry point for each language. With the names of the pages changing based on the language this solution may require some creative JavaScript and/or URL mangling to make it work. The simplicity of the foreign language files is a big plus for those who are not developers but need to modify the foreign text. This solution is also very fast because the mapping is done at compile time so it???s complete before any transforms are done. If the app needs to support a large number of languages this would be a good solution but it will force your project structure to be strange.

No comments for XSLT XML i18n »

No comments yet.

Leave a comment

(required)

(required but not published)

RSS feed for comments on this post.