add style to xml document with Css

webmasterbeta

New Member
I have been looking at ways to add style to my XML document, i came across <!-- m --><a class="postlink" href="http://www.w3.org/Style/styling-XML">http://www.w3.org/Style/styling-XML</a><!-- m --> and tried doing what he says: This is my xml document 'employees.xml'
<?xml version='1.0'?>
<?xml-stylesheet href=http://www.webdeveloper.com/forum/archive/index.php/"common.css" type="text/css"?>
<?xml-stylesheet href="modern.css" title="modern" media="screen" type="text/css"?>
<?xml-stylesheet href="classic.css" alternate="yes" title="classic" media="screen, print" type="text/css"?>
<staff>
<employee>
<age>
<dob>10-02-1967</dob>
</age>
<department>
<departmentname>Operations</departmentname>
<title>Manager</title>
</department>
<location>
<town>
<county>East Ayrshire</county>
<name>Auchinleck</name>
</town>
</location>
<name>
<forename>John</forename>
<surname>Doe</surname>
</name>
<sex>M</sex>
</employee>
<employee>
<age>
<dob>05-03-1982</dob>
</age>
<department>
<departmentname>Internet</departmentname>
<title>Developer</title>
</department>
<location>
<town>
<county>South Ayrshire</county>
<name>Ochiltree</name>
</town>
</location>
<name>
<forename>Craig R.</forename>
<surname>Morton</surname>
</name>
<sex>M</sex>
</employee>
<employee>
<age>
<dob>15-10-1981</dob>
</age>
<department>
<departmentname>Internet</departmentname>
<title>Developer</title>
</department>
<location>
<town>
<county>North Ayrshire</county>
<name>Kilmarnock</name>
</town>
</location>
<name>
<forename>Alan</forename>
<surname>McCann Jr</surname>
</name>
<sex>M</sex>
</employee>
<employee>
<age>
<dob>10-05-1972</dob>
</age>
<department>
<departmentname>Management</departmentname>
<title>Manager</title>
</department>
<location>
<town>
<county>Cumbria</county>
<name>Ambleside</name>
</town>
</location>
<name>
<forename>Bill</forename>
<surname>Brown</surname>
</name>
<sex>M</sex>
</employee>
</staff>


modern.css

ARTICLE { font-family: sans-serif; background: white; color: black }
AUTHOR { margin: 1em; color: red }
HEADLINE { text-align: right; margin-bottom: 2em }
PARA { line-height: 1.5; margin-left: 15% }
INSTRUMENT { color: blue }


classic.css

ARTICLE { font-family: serif; background: white; color: #003 }
AUTHOR { font-size: large; margin: 1em 0 }
HEADLINE { font-size: x-large; margin-bottom: 1em }
PARA { text-indent: 1em; text-align: justify }
INSTRUMENT { font-style: italic }


common.css

INSTRUMENT { display: inline }
ARTICLE, HEADLINE, AUTHOR, PARA { display: block }


however, there seem no styling at all on the document as when i open it with FF it all runs in a line....

any ideas?
 
Back
Top