XSLT for Dummies
|
Chapter 10 - To HTML and Beyond! | |
XSLT For Dummies | |
by Richard Wagner | |
Hungry Minds 2002 |
If you plan to convert your XML documents to HTML so that people can view your information with a Web browser, you have a decision to make: Where are you going to perform the transformation? You have three basic options:
If all Web browsers supported XSLT, then letting the transformation occur on the client would be a legitimate option. Take, for example, Internet Explorer 5.0 or higher. You can open up the preceding quoteslink.xml in Internet Explorer, and voil !the result document is a formatted Web page in full living color ! So if you know all your users have an XSLT-capable browser, you can create an entire XML-based Web site and have Internet Explorer transform each page on the fly. Yes, this idea rocks, but unfortunately you cant always count on all Web browsers to support XSLT. In fact, most dont. Microsoft Internet Explorer 5.0 and higher support XSLT 1.0, as does Netscape Navigator 6.1 and higher. But even these two browsers have some peculiarities and differences in how they display transformed XML documents. However, given XSLTs popularity, you will start to see more standardized and consistent support for XSLT within the major browsers. Tip The client-side transformation option can be an ideal solution within an office environment in which you can count on everyone using the same browser. Therefore, if an office is standardized on Internet Explorer 6.0 or higher, XML documents and XSLT stylesheets could be used in place of HTML files and get consistent results. Tip XSL transformations are usually best performed on the server rather than relying on the browser to do it for you. With a server-side solution, you do not need to concern yourself with browser compatibility issues, because youre sending vanilla HTML to it. Also, depending on the files involved, server-based transformation can be more efficient with respect to bandwidth, since you only need to send one HTML document to the browser rather than both XML and XSLT documents. (On the other hand, if your document has a lot of repetitive sections of HTML being created, the client-side loading could be significantly more efficient.) Additionally, if you want to reduce the load on the server, then pushing the transformation to the client browser may be a sound option, apart from the browser support nonsense . For the latest on browser support, check out the XMLSoftwares Browser page at www.xmlsoftware.com/browsers .
|