|
|
Purpose: This XSLT Participant Sorting demo illustrates both server-side and client-side transformation of XML data. The same XSLT stylesheets were used for both server-side and client-side transformations.
In the File column below, the term "server" means the file was (previously) transformed server-side (in this case by the Saxon XSLT processor). The transformed result is served to the browser as HTML (or text). Results should be invariant across all browsers, including 3rd and 4th generation.
The term "client" means the file is sent directly as XML to the browser with an external reference (i.e., a Processing Instruction) to an XSLT stylesheet residing on the server. The XML file is therefore transformed client-side by the browser to HTML (or text).
Note: For client-side transformation, Internet Explorer 5.x or higher or Netscape 6.x are required. This is therefore not the recommended solution when your user base may favor older browsers.
| File | Explanation |
|---|---|
| Raw XML | Participant data as XML, viewed in a browser-dependent manner. That is, data is generated from a database or created manually as XML, with no pre-determined output format or presentation style. |
| DTD | While a DTD isn't necessary for this application, it facilitates data entry in editors such as XML Spy. Note that only the elements Name and Organization are required. Other optional elements include: Title, URL, ExtraURL, SpecialInterests, and ContactInfo. |
| Unsorted Text, server Unsorted Text, client |
Raw data processed by XSLT, converted to text (rather than HTML), but not sorted. In the server case, a .txt file is displayed, so spacing is as generated. In the client case, although the transformation is still to text, there is no .txt MIME type clue to tell the browser to render as text, so the text output from the stylesheet simply runs together without proper white space. |
| Organization Sort, server Organization Sort, client |
XML file references an XSLT stylesheet via a Processing Instruction (client-side case) or previously transformed into HTML (server-side solution). The XSLT stylesheet sorts data primarily by Organization and secondarily by Last Name. |
| Name Sort, server Name Sort, client |
XML file references an XSLT stylesheet via a Processing Instruction (client-side case) or previously transformed into HTML (server-side solution). The XSLT stylesheet sorts data primarily by Last Name. |
View Source in your browser for the last 2 examples (client-side cases) to prove to yourself that the browser is pointing to XML which is being transformed on the fly to HTML by the reference to the external XSLT stylesheet. In other words, the URL in your Location or Address bar is an XML file, although you see HTML in the browser window. However, when you View Source, it is actually XML, not HTML.
BUG: Netscape 6.23 sorts "DLA" before "Department". However, IE 6.x, Xalan 2.3.1, and Saxon 6.5.2 all sort them the opposite. Curiously, Mozilla 1.0 (the basis for Netscape 6.2.x) does not have this sorting bug, suggesting that the XSLT engine is different.
|
|
|
Last Updated: July 31, 2002
Copyright © 2002 Kenneth B. Sall. All Rights Reserved.