Last time, I showed you how XML and Extensible Style Language (XSL) can elegantly solve the age-old problem of browser incompatibility. However, I ended the discussion just short of the crucial point: How do you build such a solution in practice?
Suppose you're in precisely the situation I described in the last issue--that is, you have
- An XML schema that fully describes all the pages on your Web site
- All the XSL views you need (e.g., one each for Microsoft Internet Explorer—IE—5.0, IE 4.0, Netscape Navigator, and a Wireless Application Protocol—WAP—device)
You can create one (or a few, depending on your project and preferences) Active Server Pages (ASP) page that redirects users to the correct XML page and identifies the proper XSL according to the browser's capabilities. You can make links and forms to point to this redirector page, such as Redir.asp, in which a command-line parameter adds enough information for the actual content. For example, in the code