OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: xml-stylesheet or <style>

[ Lists Home | Date Index | Thread Index ]



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/





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS