Rule constructions

It is useful to know how CSS stylesheet rules are constructed in order to create an XSLT stylesheet from an existing CSS stylesheet. The selector can be more than just a single element name, in the same way that the Match attribute value on the Template element can be more complex than a simple element name, though in CSS the options are not as extensive. There is no expression language in CSS, just a small number of specific options.

Merging rules

The first major difference is that there may be multiple rules in CSS for a given element. The properties in each rule are simply added together. When properties are duplicated across rules, the last rule has precedence. In the following example, the H3 element will be displayed ...

Get XSL companion, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.