Web server version - CHAPTER 4 CLIENT-SIDE XML 119 Generating XML

CHAPTER 4 CLIENT-SIDE XML 119 Generating XML on the Server The first step is much like building a dynamic web page, except that instead of generating XHTML, the application generates XML. The structure of the XML depends on the data source and the application. Transforming the XML Content into XHTML In the second stage, the application determines where the transformation should take place and transforms the data. The result of the transformation is an XHTML document that contains CSS references. If the client has the capability to transform the data, it should apply the stylesheet at that point to reduce the load on the server. However, this determination must be made on the server, so that you can apply a server-side transformation if necessary. If you re using XSLT to access a small amount of content from a larger XML document, the overhead of sending the XML to the browser may be more than the time saved in client-side processing. It may make more sense to transform the content on the server and deliver XHTML to the browser. Another alternative is to combine both server-side and client-side transformations. The server-side transform selects the content and delivers XML to the client. The client then performs another transformation to generate the final XHTML. Styling the XHTML with CSS Once the browser receives the XHTML content, it is styled with CSS either through a linked external stylesheet or through embedded or inline CSS declarations. The result is a styled XHTML page. Advantages and Disadvantages Transforming XML into XHTML is a useful approach because it offers the following advantages compared with traditional XHTML-based dynamic web pages: The application separates the data, layout, and styling of pages quite rigidly. Separating styling provides more manageability for web applications. This type of architecture can be easily adapted to a server farm environment. The application can target different platforms with the same server-side code. For example, the same content can be presented on web and mobile-phone browsers by applying a different XSLT stylesheet for each device. The same application can be used for multiple purposes. For example, stylesheets could transform application-specific XML into a format suitable for sharing with business partners. They could then browse the transformed XML with a corporate system, allowing both parties to interact without making major changes to either system. Bear in mind that if you apply XSLT transformations on the server side, the server must carry out additional processing. Through this process, you may lose gains arising from reduced server traffic.
Check Tomcat Web Hosting services for best quality webspace to host your web application.

Leave a Reply