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

Re: XSL-List Digest V4 #1026

Subject: Re: XSL-List Digest V4 #1026
From: "Shawn O. McKenzie" <smckenzie@xxxxxxxxxxx>
Date: Wed, 22 Jan 2003 13:30:39 -0800
jan mac kenzie download
Date: Wed, 22 Jan 2003 12:09:05 +0200
From: Oleg Tkachenko <olegt@xxxxxxxxxxxxx>
Subject: Re:  XML->XSLT->HTML->CSS

Shawn O. McKenzie wrote:

I am attempting to take XML files and dynamically convert to HTML with XSLT in the browser (no problem there). During the transform to HTML I throw in a reference to a CSS file. It seems that IE has no problem with this, but Netscape/Mozilla do not seem to apply the CSS.


There was old bug with it in mozilla, something with embedded css stylesheets, but I believe it's fixed a long time ago. Show us how do you "throw in a reference to a CSS file".

I have found a discussion on my exact problem at:


http://bugzilla.mozilla.org/show_bug.cgi?id=145684

However, I am still having problems getting it to work. Having not done much CSS, I'm sure I am doing something wrong. Here are the bits of my XSLT that should be relevant.

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>


<xsl:template match="/">
<html>
<head>
<link href="sample.css" rel="stylesheet" type="text/css" media="all/print/screen"></link>
</head>
Then, the part I have been trying to make work with CSS as a test case looks like this:


<p class="syntax"><b>property </b> <xsl:value-of select="$prop"/><xsl:value-of select="$arrayparams"/>: <xsl:value-of select="$type"/>
<xsl:if test="syntax/read != ''">
<b> read </b><xsl:value-of select="syntax/read"/>
</xsl:if>


 <xsl:if test="syntax/write != ''">
     <b> write </b><xsl:value-of select="syntax/write"/>
 </xsl:if>; </p>

And, just to test things, I have added the following to sample.css

p.syntax {
color : green;
font : Courier;
}

I know it is loading the .css file because if I choose View | Page Info it is listed both under the Links tab as a stylesheet and the Privacy tab as an externally loaded document.

One quote in the discussions on bugzilla relating to someone having a similar problem is

"The source XML doesn't specify a namespace, so things like the style="" attributes won't be treated as you expect because the browser doesn't assume it's dealing with HTML."

But, I thought that is what the xsl:output tag did...


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



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.