Connecting CSS and XML

Thursday, October 18, 2007

“There are three ways to connect a CSS style sheet with HTML: You can use an internal style sheet, you can use an external style sheet, or you can use the HTML STYLE attribute to associate a CSS style with a particular HTML element. You don’t have the luxury of these options in XML, at least not with the current crop of browsers. At this point, there’s really only one way of connecting a style sheet to an XML document: by using the <?xml-stylesheet?> processing instruction.

Actually, <?xml-stylesheet?> isn’t built in to the XML specification at all. (As with XML schema, W3C isn’t particularly good about indicating how you connect files such as style sheets with XML documents.) It has just become an agreed-upon convention, supported in both Netscape Navigator and Internet Explorer. In HTML browsers, you set the type attribute of processing instruction to “text/css” and the href attribute to the URI of the style sheet. You can see how this works in ch08_03.xml, which is the same as ch08_01.xml except that it uses a <?xml-stylesheet?> processing instruction to connect itself to ch08_02.css. ”

Read the full article at InformIT and see the full set of examples. This article is part of a full tutorial designed to let you teach yourself XML in 21 days. The series is done by Steve Holzner.



 
Indelv.com is for sale!
 
ERP systemen
Alle ERP-systemen op een rij, compleet met ERP-nieuws en ERP-software informatie.
www.ERPcentraal.nl
ERP systemen
Alle ERP-systemen op een rij.
www.erpmatrix.nl


Quick Links
Our Friends
Cool Places
Visit also
About Us