XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
steven matthewsSubject: CSS within XSLT ?
Author: steven matthews
Date: 27 Dec 2006 09:44 AM
HI Team,

I know that XSLT and CSS are often viewed as competing technologies but what I would like to know is whether it is possible to state CSS styling preferences within an XSLT stylesheet, as the example source code below tries to do.

The problem that I have is that I have static web pages styled with CSS, but I wish to create dynamic XML from a database dump which needs styling with XSLT (creating DHTML) using the same styles found in static web pages (under CSS control). Up to this point, I get around the problem by simply using those same styles in the XSLT style sheet.
Problem is, I have to repeat this for each XSLT style sheet used.

Could I create a generic XSLT style sheet ?

Any advice would be appreciated,

Steven M


SOURCE ...

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/SERVICES">
<html>
<body bgcolor="#F5DF91">

<head>
<title>Student Services Home Page</title>
<link rel = "stylesheet" type = "text/css" href = "styles.css" />
</head>

</body>
</html>

</xsl:template>
</xsl:stylesheet>

Posttop
Minollo I.Subject: CSS within XSLT ?
Author: Minollo I.
Date: 27 Dec 2006 09:58 AM
Only if you don't know what CSS or XSLT are you could consider them two competing technologies; CSS is about defining and using styles in your HTML pages; XSLT is about transforming XML into something else, often HTML or other XML.

You can surely create an XSLT that creates an HTML that includes and relies on a specific CSS file; you can also think about defining a shared one taking care of the CSS inclusion, then importing it in other XSLT stylesheets.

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.