Displaying XML File to CSS

Questions about XML that are not covered by the other forums should go here.
jace9
Posts: 2
Location: United Kingdom

Displaying XML File to CSS

Fri May 03, 2013 12:57 pm

Hi! I'm a learner in XML. So, I would like to know if XML file can also be display in CSS and how?
adrian
Posts: 2461

Re: Displaying XML File to CSS

Fri May 03, 2013 2:59 pm

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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
jace9
Posts: 2
Location: United Kingdom

Re: Displaying XML File to CSS

Fri Oct 25, 2013 1:47 pm

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?
adrian
Posts: 2461

Re: Displaying XML File to CSS

Wed Oct 30, 2013 5:14 pm

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
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

Return to “General XML Questions”

Who is online

Users browsing this forum: No registered users and 1 guest