Page 1 of 1

Displaying XML File to CSS

Posted: Fri May 03, 2013 12:57 pm
by jace9
Hi! I'm a learner in XML. So, I would like to know if XML file can also be display in CSS and how?

Re: Displaying XML File to CSS

Posted: Fri May 03, 2013 2:59 pm
by adrian
Hello and welcome,

I'm not quite certain of what you're asking.
Do you want to style an XML with the help of a CSS?

Regards,
Adrian

Re: Displaying XML File to CSS

Posted: Fri Oct 25, 2013 1:47 pm
by jace9
adrian wrote:Hello and welcome,

I'm not quite certain of what you're asking.
Do you want to style an XML with the help of a CSS?

Regards,
Adrian
Yes. How can I do that?

Re: Displaying XML File to CSS

Posted: Wed Oct 30, 2013 5:14 pm
by adrian
Hi,

The same CSS rules apply for XML as for HTML, but obviously adapted to the specific elements, attributes and content of your XML file. If you want to learn CSS I suggest starting with: http://www.w3schools.com/css/

To associate a CSS to an XML document you need to specify in the XML a processing instruction like this before the root element:

Code: Select all

<?xml-stylesheet type="text/css" href="mycssfile.css"?>
If you are using Oxygen you can check out some of its XML+CSS samples.
e.g. Oxygen/samples/personal.xml and Oxygen/samples/personal.css
personal.css has some custom CSS extensions specific to Oxygen, but these can be easily identified due to their different namespace prefix (oxy).

Regards,
Adrian