forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicola Ken Barozzi <nicola...@apache.org>
Subject Skin colors from skinfconf into CSS
Date Mon, 29 Dec 2003 11:42:27 GMT

Here is an example CSS file (taken from inst.css of tigris-style skin) 
that is generated from skinconf.

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
   <xsl:output method = "text"  omit-xml-declaration="yes"  />

   <xsl:template match="skinconfig">
   <!-- insert CSS here -->

/* $Id: inst.css,v 1.1 2003/12/22 09:54:41 nicolaken Exp $ */

#cn {
	background-image: url(../<xsl:value-of select="group-logo"/>);
	display: block;
	height: 17px;
	width: 138px;
}

#poweredby {
	background-image: url(../<xsl:value-of select="host-logo"/>);
	display: block;
	height: 38px;
	width: 102px;
}

#sc {
	background-image: url(../<xsl:value-of select="project-logo"/>);
	display: block;
	height: 25px;
	width: 138px;
}

   <!-- end CSS here -->
   </xsl:template>

   <xsl:template match="*"></xsl:template>
   <xsl:template match="text()"></xsl:template>

</xsl:stylesheet>


To see it working, just transform skinconf.xml with it, and on the test 
site you will get:

/* $Id: inst.css,v 1.1 2003/12/22 09:54:41 nicolaken Exp $ */

#cn {
	background-image: url(../images/group.png);
	display: block;
	height: 17px;
	width: 138px;
}

#poweredby {
	background-image: url(../);
	display: block;
	height: 38px;
	width: 102px;
}

#sc {
	background-image: url(../images/project.png);
	display: block;
	height: 25px;
	width: 138px;
}

With XSLT this is IMHO as easy as it gets. I could do a thing though. I 
can make an xml version of it and xslt it into becoming like the above xslt:

<conf-template>

/* $Id: inst.css,v 1.1 2003/12/22 09:54:41 nicolaken Exp $

#cn {
	background-image: url(../<value>group-logo</value>);
	display: block;
	height: 17px;
	width: 138px;
}

#poweredby {
	background-image: url(../<value>host-logo</value>);
	display: block;
	height: 38px;
	width: 102px;
}

#sc {
	background-image: url(../<value>project-logo</value>);
	display: block;
	height: 25px;
	width: 138px;
}

</conf-template>

What do you think, should I use the plain XSLT (which seems simple 
enough for me) or go with the simplified version?

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


Mime
View raw message