How to attach CSS file to xml file format?



This is my first xml file testing with a css file. I was following a tutorial on youtube. There was one difference between output I got and the output in the video


When this guys is creating a xml file which is:



<?xml version="1.0" encoding="utf-8"?>
<first>
This is first XML here
</first>


and open this file in browser, he gets content which is



<first>
This is first XML here
</first>


but when I did same thing I got this in the browser



This is first XML here


I ignored this difference and then I added css file:


I created a style.css file in same folder:



first
(
display : block;
font-family : Arial;
font-size : large;
color : Blue;
)


And then I changed xml file to this:



<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="style.css"?>
<first>
This is first XML here
</first>


but output in the browser is same as before. It seems css does not changing anything. I am using Xmplify XML Editor on Mac OS and also I used Safari and google chrome for the output but neither of them worked. I appreciate if anyone can help me with that.


No comments:

Post a Comment