Forum How do I...?

xml file ..how to add a .css file

DarkLord
<xml>
<?xml-stylesheet type="text/css" style.css"?>

<note>
<to> Joe </to>
<from> Jack </from>
<re> XML file working with some CSS sheets </re>
<body> Simple XML file to different CSS sheets I created</body>
</note>

my style sheet looks like this and is in the same folder
BODY
{
color:Purple;
}
NOTE
{
background-color: Maroon;
}

any help is much appreciated. thanks in advance
mikeday
The <?xml-stylesheet?> processing instruction must occur before the root element of the document, and must have a href attribute:

<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="style.css"?>
<note>
...
</note>

XML is case-sensitive, so <body>, <Body> and <BODY> will be treated as entirely distinct tags. For this reason, the selectors in CSS style sheets applied to XML are also case sensitive, and must match the case of the XML elements:

body  { color: Purple; }