This is the mail archive of the
docbook@lists.oasis-open.org
mailing list for the DocBook project.
Re: Creating CSS within XSL DocBook Stylesheets
I've added the statement as suggested to the XSL file.
But does not have any affect. See code below "you
wrote:".
There is something happening behind the scenes that I'm not seeing
It works with an HTML link statement in the XSL file.
<link rel="stylesheet" href="CStyle.css"
type="text/css"></link>
<html>
How would one format a debug print statement within you if test?
<xsl:text><xsl:value-of
select="@html.stylesheet"/></xsl:text>
<xsl:text><xsl:value-of
select="html.stylesheet"/></xsl:text>
I have attempted both of the above and Xalan becomes angry.
<xsl:if test="$html.stylesheet">
<link rel="stylesheet"
href="{$html.stylesheet}"
type="{$html.stylesheet.type}"/>
</xsl:if>
At 08:26 AM 3/23/00 -0500, you wrote:
2. Or you can add CLASS attributes and use an
external stylesheet.
On the whole, this is probably the better approach.
If you set the XSL variable html.stylesheet to the name of a
stylesheet,
The stylesheets will automatically add an appropriate link
element
to the head of each HTML document.
<xsl:variable
name="html.stylesheet">mystyle.css</xsl:variable>
E:\docbook\IT>java org.apache.xalan.xslt.Process -in
E:/docbook/It/test.xml -xsl
E:/docbook/html/test.xsl -out out.html
E:\docbook\IT\CStyle.css is in same directory as xml file.
---------------------------------- CStyle.css
----------------------------------
.title{
/*
all elements with CLASS="title" */
font-family:
Times New Roman;
font-style:
normal;
font-weight:
bold;
font-size:
18pt;
color:
#cc6600;
}
---------------------------------- test.xsl
----------------------------------
<?xml version='1.0'?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'>
<xsl:variable
name="html.stylesheet">CStyle.css</xsl:variable>
----------------------------------
out.html ----------------------------------
<div class="section" id="objectives">
<h2 class="title"
style="clear:
all">
<a name="objectives"><b>1. Objectives of the
Guideline:</b></a>
</h2>