[xsl] useful extension to XSL??

Subject: [xsl] useful extension to XSL??
From: Adam Van Den Hoven <Adam.Hoven@xxxxxxxxxxxx>
Date: Tue, 26 Jun 2001 13:53:51 -0700
Hey guys, 

I'm working on building a reusable XSL framework for creating HTML destined
to run on Pocket IE over wireless networks. One of the limitations that is
killing me is the inability to use CSS. It makes my life miserable,
especially since I want to be able to sepecify styling information at the
last instant. I'd also like to be able to reuse styling information from the

On and off I've come across situations where I would dearly love to have
access to CSS properties from within XSL. Obviously its not going to happen.
However, it seems to me that it might be worth while to be able to resolve a
selector into some XML representation of css.

This might be done with a function:

<xsl:variable name="CSSValues" select="resolveCSS('test.css', 'td.(titles
main)#id23', 'css2', 'verbose')" />

Or perhaps instead of loading the CSS at request time you might have CSS
link tags in the document and use those by default. The last two would be
used to determine which properties to use and whether to provide all
possible properties (with defualts) or just the ones specified in the CSS. 

At this point $CSSValues would contain something like:
<css selector="td.(titles main)#id23">
	<property name="background-color">#ccccff</property>
	<property name="font-family">verdana</property>

You may also want to have a function composeCSSStyleProperty(nodeset,
format) to generate a style attribute you could use for your output HTML.
More importantly I know how to handle many CSS2 properties manually (font
tags, images for padding....) so I could reasonably reproduce the style.
Interestingly, I could also provide CSS2 formatting for older browsers
without the positioning. 

Anyways just a thought.

Adam van den Hoven
Internet Software Developer
Blue Zone
tel. 604 685 4310 ext. 280
fax 604 685 4391

> Blue Zone makes you interactive. http://www.bluezone.net/

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread