Skip to Content
Real World XML
book

Real World XML

by Steven Holzner
January 2003
Beginner to intermediate content levelBeginner to intermediate
1200 pages
23h 42m
English
Peachpit Press
Content preview from Real World XML

Attaching Stylesheets to XML Documents

In HTML, there are three ways of connecting stylesheets to documents: You can use the <STYLE> HTML element to attach an internal or external stylesheet, or you can use the STYLE attribute in HTML elements to style an individual element. In XML, there's really only one way of connecting a stylesheet to an XML document, and that's by using the <?xml-stylesheet?> processing instruction (in fact, <?xml-stylesheet?> is only an agreed-upon convention and does not appear in the XML 1.0 W3C recommendation). To use <?xml-stylesheet?> with CSS stylesheets, you set the type attribute to "text/css" and set the href attribute to the URI of the stylesheet. For example, to attach ch09_02.css to the XML document, I can ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Inside XML

Inside XML

Steven Holzner
XML Hacks

XML Hacks

Michael Fitzgerald

Publisher Resources

ISBN: 0735712867Purchase book