Every valid stylesheet must start with the root element stylesheet and define its own namespace according to the W3C directions. Once the skeleton is done, you must include your template elements, which are the basic units of operation for the XSLT language. Each template is matched against the occurence of some elements in the original document and the element is replaced with the child elements of the template, if they belong to other namespaces, or, if they belong to the XSLT namespace, they are further processed in a recursive way. This must be transformed into all those tags that identify a good HTML page. When a document is processed by an XSLT processor, its output is exactly the same for every browser that requested the page.
Cocoon is able to discriminate between browsers, allowing the different stylesheets to be applied.
This is done by indicating in the stylesheet linking PI the media type. This powerful feature allows you to design your content independently and to choose its presentation depending on the capabilities of the browser agent. The media type of each browser is evaluated by Cocoon at request time, based on their User-Agent http header information. Mozilla indicates that Cocoon should look for the token MSIE inside the User-Agent HTTP request header first, then Opera and so on, until Mozilla . Using query parameters during XSL transformation Quite often you want to create pages that depend on some user-supplied data.