Click here to Skip to main content
13,043,092 members (57,128 online)
Click here to Skip to main content
Add your own
alternative version


1 bookmarked
Posted 19 Mar 2012

Connect an External Stylesheet to XML

, 19 Mar 2012
Rate this:
Please Sign up or sign in to vote.
How to connect an external stylesheet to XML.


In this short how to, I will demonstrate how to connect an external stylesheet to your XML. First I will show what the XML code looks like, this will call in the stylesheet. Next I will show you a sample of the CSS file.

Using the code

First we we need to create the XML file, below is a sample:

<?xml version="1.0? encoding="ISO-8859-1??>

Next, we will create the CSS file, below is a sample, the file is called mycssfile.css.

/****************** mycssfile.css **************/

@charset "utf-8?;
/* CSS Document */
font-family:"arial, helevtica;

Notice that the following line of code in your XML file is used to call the stylesheet.

The XML was created and validated using Liquid XML Editor.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

United States United States
This member doesn't quite have enough reputation to be able to display their biography and homepage.

You may also be interested in...

Comments and Discussions

QuestionThe line to add to the XML?? Pin
Matt T Heffron20-Mar-12 7:25
memberMatt T Heffron20-Mar-12 7:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170713.1 | Last Updated 19 Mar 2012
Article Copyright 2012 by tomjoly45
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid