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

Re: xml-stylesheet or <style>


xml stylesheet


Frans Englich wrote:


> As far as I can tell, there is two possibilities for specifying a CSS for an 
> XHTML document; via the (application) mechanism html/head/{style,link}; and 
> via the XML processing instruction xml-stylesheet. The former works only for 
> XHTML, while the latter works for any XML application.
> 
> When in the need of associating a CSS with an XHTML document, what is the best 
> method? What differs them apart? Does it matter?

If you are serving XHTML content as application/xhtml+xml or a generic 
XML media type like application/xml or text/xml then both Mozilla and 
Opera 7 apply stylesheets linked in with an XHTML <link> element e.g.
   <link xmlns="http://www.w3.org/1999/xhtml"
         rel="stylesheet"
         type="text/css"
         href="style.css" />
there is no need to use the xml-stylesheet processing instruction. Those 
browsers even apply XHTML
   <style xmlns="http://www.w3.org/1999/xhtml" type="text/css">...</style>
without any need to use an xml-stylesheet processing instruction. So as 
long as you make sure you have the right namespace on your <link> or 
<style> element there is no need to the processing instruction, in my 
experience even if you use XML but not XHTML.

The page
   http://www.w3.org/Style/styling-XML#Embedded
suggests that you can use an xml-stylesheet processing instruction with 
a fragment identifier to link to some embedded CSS rules but so far 
neither Opera nor Mozilla support that. Mozilla has a bug on that filed 
but so far it has only brought up questions on whether/how that fragment 
indentifier makes sense
   https://bugzilla.mozilla.org/show_bug.cgi?id=61675


-- 

	Martin Honnen
	http://JavaScript.FAQTs.com/


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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.