O'Reilly logo

Special Edition Using XML, Second Edition by - et al. David Gulbransen

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

Using CSS Formatting with XML

Now that you have seen how CSS rules are formed and are familiar with some of the properties and values that you can manipulate to influence how your elements are displayed, we can look at an example of an XML document formatted with CSS.

Listing 7.1 shows a newspaper.xml document which we are going to format for display with CSS. This document is a regular, well-formed XML document, with only one special line, which is immediately following the XML Declaration. That line is

<?xml-stylesheet type="text/css" href="newspaper.css"?> 

This line is a processing instruction, which is used to link our stylesheet to the XML document. It has two attributes, one of which is type that is used to specify the type of stylesheet ...

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