This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: CSS and XSLT, again
- To: Shimon Pozin <spozin at broadbase dot com>
- Subject: Re: [xsl] CSS and XSLT, again
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Tue, 6 Feb 2001 09:31:55 +0000
- CC: "'xsl-list at lists dot mulberrytech dot com'" <xsl-list at lists dot mulberrytech dot com>
- Organization: Jeni Tennison Consulting Ltd
- References: <C99BAEFE5F0ED41193E200508B6BD6388B25B4@torexc1>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Shimon,
> Yes, Michael, this is what I do (I actually load CSS file and
> include its text in between <style>), but I thought this way is
> awkward. I thought there is a way to "import" style into xsl file
> like "include" for asp pages (if we are talking about IIS)
Well, you could use the traditional XML way of declaring an entity and
then importing that:
<?xml version="1.0"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY style SYSTEM 'style.css'>
]>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<head>
<title>...</title>
<style>
&style;
</style>
</head>
<body>
...
</body>
</html>
</xsl:template>
...
</xsl:stylesheet>
The advantage of this over using document() to pull in the CSS file is
that you don't have to wrap the CSS in an element - you can just have
the CSS file as normal CSS text.
No doubt eventually you'll be able to use XInclude (see
http://www.w3.org/TR/xinclude) or perhaps even XLink instead but I
don't think that any of the XSLT processors/XML parsers support this
at the moment.
I hope that helps,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list