oXygen-like CSS Colours for XML

I use oXygen as my preferred XML editor. I highly recommend it, it has lots of good features. By default XML markup in oXygen looks something like:


When I’m writing encoding documentation for users I thought it might be nice to have the CSS for the HTML manual (generated from a TEI P5 ODD XML customization file) use the same colours as are in the editor itself. Rather than try to guess the colours I asked the nice oXygen people and they told me that they are:

  • XML text nodes (plain text) – “0,0,0”; #000000
  • ‘<‘, ‘>’ – “0,95,242” ; #005FF2
  • XML tag name – “0,0,150”; #000096
  • XML comments – “0,100,0”; #009600
  • XML DOCTYPE declaration – “0,0,255”; #0000FF
  • XML EMBEDDED DOCTYPE, “0,0,255”; #0000FF
  • XML QUOTED VALUE – “153,51,0”; #993300
  • XML ENTITY – “150,150,0”; #969600
  • XML ATTRIBUTE NAME – “245,132,76”; #F5844C
  • EQUAL sign (for attribute value) – “255,128,64”; #FF8040
  • XML PROCESSING INSTRUCTION – “139,38,201”; #8B26C9
  • XML CDATA section – “0,140,0”; #008C00
  • XML PROLOG – “139,38,201”; #8B26C9
  • not well-formed fragment – “255,0,0”; #FF0000

Although my example above doesn’t show all of these, it now means that my CSS can use these values for colouring XML markup. Thanks oXygen!

Posted in XML | 5 Comments

5 Responses to “oXygen-like CSS Colours for XML”

  1. Sharon Goetz says:

    That is indeed useful! Thank you for posting it.

    Curiosity–do you use a typed pair of angle brackets or < and > for the blog title? It appears in my RSS/Atom reader as “In my ” with “element” missing.

  2. James Cummings says:

    Hi Sharon,

    That’s a shame. No, I escape them in wordpress when setting the title of the blog as < and > and if I go back and edit it, then wordpress has already de-escaped them and it will vanish. I didn’t realise it vanished in WordPress generation of RSS/Atom but I am not surprised. Maybe I should use a unicode angle-bracket looking character instead that it doesn’t take as markup….


  3. Saqib Ali says:

    Greetings James,

    Thanks for posting this. I also like the oXygen colour scheme. Not sure if you have used the browser based XML editor in the Microsoft OneDrive. The editor is really nice, but the colour scheme is uses is not so good. I will send this blogpost to OneDrive team and ask them if they can change to this colour scheme.

    Thanks!! :)

  4. James Cummings says:

    I’ve not used Microsoft OneDrive so wouldn’t know. oXygen is likely to have better continual validation and other XML IDE features though.

  5. Saqib Ali says:

    @james, agreed. oXygen is a professional XML editor. The xml editor in One Drive is more for quick editing and touch ups.

Leave a Reply