O'Reilly logo

Real World XML by Steven Holzner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required