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

Re: CSS and XSLT, again

Subject: Re: CSS and XSLT, again
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Tue, 6 Feb 2001 09:31:55 +0000
xslt importing css
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


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.