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

Re: XSL/HTML styling and CSS style sheets

Subject: Re: XSL/HTML styling and CSS style sheets
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Thu, 4 Dec 2003 15:27:33 +0000
embed css in html
Hi Jackson,

> I am a newbie to XSL. ?My first XSL project is to try to turn one of
> my html pages into an XML/XSL page and I am trying to figure out how
> to make my page look the same way it did when it was just html.? I
> was kinda hoping that I could just embed my CSS the same way I used
> to in the html page:
>
> <link rel="stylesheet" type="text/css" href="/styles.css">
>
> But this doesn?t work.

In what way doesn't it work? All that XSLT does is allow you to create
the HTML page from XML rather than the HTML page being static; the
HTML page that you create using XSLT should otherwise look exactly the
same as the original HTML page, including any <link> element, and then
work in exactly the same way in terms of styling.

Perhaps you're getting an error because you've tried to include the
above tag in your XSLT stylesheet without closing it? Remember that
the XSLT stylesheet must be a well-formed XML document, which means
all the tags must have closing tags. When the XSLT generates an HTML
document (using the html output method), any elements that shouldn't
have a close tag (such as the <link> element) will be serialized
without a close tag.

So try:

<xsl:template match="/">
  <html>
    <head>
      <title>TEST</title>
      <link rel="stylesheet" type="text/css" href="/styles.css" />
    </head>
    ...
  </html>
</xsl:template>

Cheers,

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.