[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: embad css in in xsl

Subject: Re: embad css in in xsl
From: "Joris Gillis" <roac@xxxxxxxxxx>
Date: Wed, 09 Mar 2005 13:15:36 +0100
embad
Tempore 00:09:30, die 03/09/2005 AD, hinc in xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit henry human <henry_human@xxxxxxxx>:

is that possible to define format of element in a xsl
stylesheet (embad css Stylesheet like in html head)?

Hi,


There are two ways to interpret your question.
1) you want to display the xsl document itself by means of an css stylesheet


Just like in any xml document, you can add reference to stylesheets:
consider this XSLT:

<?xml-stylesheet type="text/css" href="test.css"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" />


<xsl:template match="root">
xsl code
</xsl:template>

</xsl:stylesheet>

and a css file , named 'test.css', containing:

@namespace xsl url(http://www.w3.org/1999/XSL/Transform);
xsl|template {color: red}

Then the XSL document could be rendered as a string 'xsl code' in red.

2) you want to embed css rules in your output document.

Just make the necessary elements be added to the result tree:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes" />


<xsl:template match="root">
<html>
	<head>
		<style type="text/css">
			/*css rules here*/
		</style>
	</head>
	<body>
		<p>test</p>
	</body>
</html>
</xsl:template>

</xsl:stylesheet>


regards, -- Joris Gillis (http://www.ticalc.org/cgi-bin/acct-view.cgi?userid=38041) Fiat W3C in tenebris

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.