Styling XML

Styling XML


Normal CSS stylesheets may be used to control the display formatting of the information in an XML document. Here is a very simplified style sheet to use on our example...

The first line will make the contents of each element display in block formation. (it will take up the full line and put the next bit of information on the next full line).

The second line will format the information found within the title tags.

Saving that snippit as "example.css" we can then attach it to the XML example coding...

Now that there is some formatting applied to the XML page, it will actually display the data only instead of all of the raw tags.

This example wont win any great awards, but it does its job by showing the example in action :)

XSL and XSLT is used to format an XML document correctly. CSS is good for HTML coding, but XSL will take our XML document to a much higher level of formatting.

Table of Contents

Elements and Attributes