[xsl] Doing a cascade...

Subject: [xsl] Doing a cascade...
From: adam_vandenhoven@xxxxxxxxxx
Date: Tue, 22 Jan 2002 11:52:04 -0800
Hey guys,

I've hit a bit of a wall. I'm sure I've done this before but I haven't had
an opportunity to do any XSLT for 3 months and I'm missing something

Some background:
When I build a framework for a website, I tend to use a hierarchy to
organize my styles, this allows me to reuse class names that make sense. I
might have

.HomePage .headline{color:#efefef;}
.DetailPage .headline{color:#1212ff;}

because my organization get rather complex (and CSS doesn't really allow
you to do things in a hierarchy). I built an XML schema to manage my CSS.
Becuase there are many times when I like to reuse the same chunk of CSS in
different locations, I created an idea of themes that encapsulate them and
are refered to in my rules. The XML looks something like:

<stylesheet>
 <theme id="sometheme">
  <property name="CSSPropertyName">value</property>
  <property name="CSSPropertyName">value</property>
 </theme>
 <rule>
  <selector><!-- selectors here --></selector>
  <property themeid="sometheme" />
  <property name="CSSPropertyName">value</property>
  <property name="CSSPropertyName">value</property>
  <rule>
    <selector><!-- selectors here --></selector>
    <property name="CSSPropertyName">value</property>
    <property name="CSSPropertyName">value</property>
  </rule>
 <rule>
</stylesheet>

So far I've been able to generate the selector without a problem. I've run
into problems with generating the properties. What I want to do is create a
cascade (of sorts) of the properties, taking the last instance of a CSS
property from a nodeset that is made up of all the properties of the rule
plus all the properties of the themes that are refered to. The theme
properties would come first and the rule properties would come last.
Ideally I'd like to see the themes retrieved in the order in which they are
listed in the rule but I'm willing to live with source order if I must.

Anyone have any idea?

Adam



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


Current Thread