you're misunderstanding XSLT. CSS is used to style/layout an existing (XML/HTML) markup. XSLT is used to change the markup itself (thus changing the structure rather than the style, which leads to a different presentation*).
Quote:
Originally Posted by moltendorf
is there a way to apply CSS to the XHTML you "generate" using XSLT?
sure, output an element that's loading the stylesheet. (either <link> or <style>)
* example
- // your xml
-
<?xml version="1.0" encoding="iso-8859-1" ?>
-
<root>
-
<echo>Hello World!</echo>
-
</root>
while CSS tells the browser how to display the <root> and <echo> elements, XSLT changes the XML to a (e.g.) HTML
- // XSLT result
-
<!DOCTYPE ...>
-
<html>
-
<head>
-
<title>Example</title>
-
<link rel="stylesheet" href="sample.css">
-
<head>
-
<body>
-
<p>Hello World!</p>
-
</body>
-
</html>
note: you can apply XSLT inline so that the sent markup is the same, but the document tree (DOM) the browser loads and uses is the result of the transformation. nevertheless many people prefer to do the transformation server side and only deliver the result (e.g. me).