tags:

views:

23

answers:

3

I want to provide user facility to change the CSS.

  1. First think clicked is that storing CSS as XML will help me read CSS and understand.
  2. Second is that using XSLT i will be able to generate the CSS (am i right ? will that be useful)
  3. Lastly when user changed the CSS XML file can be updated and then it can be used.

Now this is at very rough level ..... i am using ASP.NET can some one please guide me if my understanding is correct or not and how should i approach for this pros/cons.

Will something like below will work ? is possible?

<link src="someserverfiletoprocessxmlusingxslt.aspx?user=id" type=text/css/> 
A: 

Using an ASP.NET generic HTTP handlers (ashx) would be better. This is just a class that gives you access to the output stream (better for non-html output).

From there you can process the XML, transform it using XSLT and write/dump it on the output stream.

Might be a good idea to implement some kind of caching to enhance performance...

More info on generic handlers: http://www.brainbell.com/tutorials/ASP/Generic_Handlers_(ASHX_Files).html

Koen
A: 

That is possible; your ASPX page would need to return CSS with a MIME type of text/css.

However, it would be better to use an ASHX (Generic Handler) rather than an ASPX (Web Form).

SLaks
A: 

Setting the method attribute of the xsl:output element to text will strip the resulting output of all XML tags and return it unencoded.

Ignacio Vazquez-Abrams