THL Toolbox > Developers' Zone > Web-development > Making Web Pages In Tibetan Unicode > How to Make Tibetan Webpages - A Standard Approach
Contributor(s): Chris Walker
In the best of all possible worlds, Tibetan webpages should look and behave the same everywhere. That is to say, it shouldn't matter whether your visitors are coming from a Mac, Windows, or Linux environment. Their choice of web client software, as well, should not hinder their experience of your site. Recent versions of Safari, Firefox, Opera, and Internet Explorer are all powerful enough to render standard Tibetan Unicode webpages. The operative word here is "standard," as this concept has special connotation for web developers. To make your Tibetan webpages robust and rational, you need to follow a web-standards approach. This guide should offer some help.
Any webpage that does not validate as a standard XHTML page is plainly poor design work and an invitation for future headaches. Wherein the past Tibetan webpages had to depend on all kinds off skillful hacks and cryptic encoding schemes, this practice has been nullified by Unicode, or rather, by the wide implementation of Unicode by the computer industry. With the advent of the Leopard for Mac, and Vista for Windows (both operating systems with Tibetan Unicode font and keyboards built in), there is simply no good excuse for building a non-standard Tibetan webpage. But enough with the lecture, let's dig in!
CAUTION: We're assuming that you have a bit of background in webpage development. If not, some of the explanation may be too fast and furious for you. Understanding XHTML and CSS is an entire subject unto itself, and you may want to revisit this page only after you've delved into some basic tutorials. On the other hand, for the real web geeks out there, some of the following discussion may seem obvious. What we are discussing here are best coding practices, not overall design and layout issues. We are specifically looking at the underneath source syntax and structure of the webpage, and not methods for easy visual editing (like you might see in a generic word processor).
A basic source template for an XHTML webpage would include the doctype declaration with head and body sections within the html root node:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Tibetan Webpage Example</title> </head> <body> </body> </html>
Here we are using the xhtml 1.0 strict doctype in the first two lines. The specific doctype declaration is important, as it governs how your page will validate. By chosing the strict version, we are dissallowing the use of deprecated html tags which shouldn't be part of your markup anyway. We are striving to make the syntax of the webpage follow XML markup as much as possible. XML is the gold-standard of interoperability, as it is really used everywhere these days.
NOTE: By choosing version xhtml 1.0 and not 1.1, we are allowing for the use of the lang attribute inside our tags. We'll need to the lang attribute to tell the browser when we have Tibetan language content. XHTML 1.1 does not allow for the lang attribute without specifically assigning it the xml namespace (ie. xml:lang), but since most browsers currently (2008) do not do anything with the xml:lang attribute, we need recourse to the unqualified lang attribute (which current browsers do parse). For good measure, and for foward compatibility, we'll define our Tibetan language content with both lang and xml:lang tags - a redundancy that xhtml 1.0 is suited for. You'll see this in action later on below.
Notice that the <html> tag has been assigned an xmlns attribute pointing to a URL on the web where the xhtml standard has been defined. We are in effect telling the browser that we are following standards-based markup devised the World Wide Web Consortium. We are putting our following html tags in a particular namespace. The concept of namespaces can be confusing, and you don't need to know much about it for what we're doing. Suffice it to say that we are simply telling the browser that the tags we are using should be interpreted according to the prevailing web standard. We're also indicating that if we are going to use other markup that doesn't belong to xhtml (such as scalar vector graphics, for example) that we're going to qualify those tags with a unique prefix, such as "svg:…", and assign that prefix a namespace outside the realm of xhtml. In any case, the point is, we're being standard, and we're being explicit where our standards are coming form. You'll see that word "standard" appear here over and over, but it's a point that can't be overstated.
@@@@ working @@@@
Provided for unrestricted use by the Tibetan and Himalayan Library