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

Re: Basic Question about Adding Styles to XSL

Subject: Re: Basic Question about Adding Styles to XSL
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Tue, 11 Jul 2006 11:17:37 -0400
adding style in xslt

My question is - is this the best way to do it?

You are proposing a perfectly good way to do it. Whether it is the best way depends on external factors such as how you intend to maintain your CSS (is it a benefit to do so inside the XSLT?) and whether you mind the extra bandwidth of serving it over and over again inside many pages, or would rather have recipients cache it on their systems (an advantage of out-of-line CSS). In other words, the usual CSS architecture tradeoffs.

Can I add a link to an external style sheet in the XSL?

Absolutely. From the XSL point of view, such an HTML <link/> element is just another result element, no different from any other. The HTML file that results would have to be located (statically or "virtually", if served up at request) someplace where the link resolves properly when the client looks for it; but that's not an XSLT issue either.

If you look at the HTML source code of the files served up by my XML/XSLT demo application the Sonneteer (http://www.xmlshoestring.com/Sonneteer) you'll see they call out to external CSS files, which are served up by Apache Cocoon just like the XSLT transformation results.

It's also possible to have CSS both in and out of line, again in the usual way.


Current Thread


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.
First Name
Last Name
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.