The difference between CSS and XSLT |
|
They're both style sheets, right? |
By Jennifer kyrnin
Http://webdesign.about.com/library/weekly/aa101901a.htm
Cascading Style Sheets or CSS were developed a few years ago to define the look and feel of markup ages. extensible style sheet language for transformations or XSLT were created to transform documents. they are both style sheets, but they serve vastly different purposes.
What CSS can do
- Modify the font size, color, family, and style of text in Markup
- Define the location and size of an element
- Change the background image and color of Elements
- Create a new look and feel for markup pages to display on the Web
What CSS cannot do
- Change the order of elements in a document
- Make computations based on the content of the document
- Add content to the document
- Combine multiple documents into one
XSLT is a powerful language for transforming documents. it was created to allow developers the ability to create data and then transform it to varous different formats. it is meant to keep the distinction between content and design separate.
What XSLT can do
- Convert data in a standard XML format to SQL statements, tab-delimited text files, or other database formats for data sharing
- Transform XSLT style sheets into New Style Sheets
- Turn web pages (written in XHTML) to voiceml or XHTML basic for handheld devices
- Add CSS style sheets to XML documents for view in a browser
If all you're looking for is a style sheet to manipulate the way your content looks in a document, then you shoshould use CSS. but if you're looking to actually transform one document into another, then XSLT is your tool.