External XML Style Sheets


The first part of this chapter shows how to link to style sheets from HTML documents. Most documents on the Web are HTML documents, and we expect this to be the case in the future. We also expect some new document formats to be developed for the Web. These are likely to be based on XML. Unlike HTML, XML-based documents will come with no conventions on how to display them and a style sheet will always be required. Therefore, work has been started to find a common way for all XML-based document formats to link to style sheets. So far, only the XML equivalent of HTML's LINK element has been defined. For example, in HTML, you could use the LINK element like this:

 <LINK HREF="/style/mystyle" REL="stylesheet" TYPE="text/css"> 

The XML equivalent would be as follows:

 <?xml:stylesheet href="/styles/mystyle" type="text/css"?> 

Note the question marks that appear inside the angle brackets one at the beginning and one at the end. The question marks turn what would otherwise be a normal element into a processing instruction. Processing instructions are not used in HTML documents. In XML-based documents, they are used to do various tasks and linking to style sheets is one of them.

In Chapter 16, we see that XML documents are case-sensitive. So, although you could write <LINK...> or <link...> in HTML, you must always use the lowercase <?xml:stylesheet href... type...> in XML.

We expect that XML-based formats will also offer the equivalence of the STYLE element and the STYLE attribute as found in HTML, but at this point, this is only a proposal.



Cascading Style Sheets(c) Designing for the Web
Cascading Style Sheets: Designing for the Web (3rd Edition)
ISBN: 0321193121
EAN: 2147483647
Year: 2003
Pages: 215

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net