Posted on 2006-06-06
Medium Priority
Last Modified: 2013-11-18
We want to include CSS information (.css) in XSLT for presentation in (X)HTML.
How to?
Question by:go4java
1 Comment
LVL 60

Accepted Solution

Geert Bormans earned 2000 total points
ID: 16841050
Hi go4java,

You can just stuff your CSS in your result document as you would do with a static HTML file

here is an example

test XML
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="mystyle.xsl" type="text/xsl"?>
    <elemA>This should be blue</elemA>
    <elemB>This should be green</elemB>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
                .blue {background-color: blue;}
                .green {background-color: green;}
    <xsl:template match="elemA">
        <p class="blue"><xsl:value-of select="."/></p>
    <xsl:template match="elemB">
        <p class="green"><xsl:value-of select="."/></p>

<link> is as easy


Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question