Click to See Complete Forum and Search --> : XSLT or CSS for client side?
msubbareddy
April 8th, 2002, 08:18 AM
Hello Gurus,
I have ASP page, which generating xml page with dynamic data.
For this, i am planning using xsl file to parse and display on IE browser.
So, here is my query
Why do I use xsl, why not CSS to display the xml file on browser.
Please, tell me what is difference between xsl and css?
Thanks in advace.
SubbaReddy
eahmed
April 13th, 2002, 10:21 AM
You choice depends on a few factors:
* Content of your XML files
* Complexity of your transformations
* Capabilities of your users' browser
** Content of your XML files
CSS is great for simple transformations; however, if your XML files have elements that contain attributes then your only choice is to go with XSLT. CSS does not have access to an element's attributes whereas XSLT does.
** Complexity of your transformations
Sometimes you want to transform XML into HTML based on some XML content. For example, if you want to display a bulleted listing for a list of 10 items or less and a table for a listing of 11 items or more, CSS is not an option. XSLT allows you to make decisions and use variables during transformation.
** Capabilities of your users' browser
This is important because not all browsers support XSLT or CSS uniformly. For example, Internet Explorer supports CSS1 and XSLT. You have to be careful what XSLT functionality you use on the client since XSLT depends on MSXML - Microsoft's XML Parser. If the user has an older version of the parser on their system and you're using some functionality that's available in a newer version then you're going to have some puzzled users (since the advanced functionality won't work).
Essam Ahmed
___________________________________________________
Author of JScript .NET Programming - Now Avaialble!
http://www.designs2solutions.com/jsnetprg
codeguru.com
Copyright WebMediaBrands Inc., All Rights Reserved.