Feed.Style logo  XML Styling with Javascript

What is this?

Most websites have several .xml files that are used by search engines and other services to index and follow the site.

By default, these files look horrible when a human looks at them in a browser. But there is a simple way to make them look better: includes a single Javascript in your XML file!

RSS/Atom Feeds RSS/Atom Feeds

RSS and Atom news feeds are a great way to get updates from your favorite sites.

Sitemaps Sitemaps

Sitemaps (sitemap.xml files) help search engines index your site.

Outlines Outlines

OPML Outlines are a great way to share the sites in your news feed.

How do I use it?

You need to include a <script> tag in your XML file.

At the top of your XML file, it will look like:

<?xml version="1.0" encoding="UTF-8"?>
<data-depends-on-type>
...
  

Add a new third line so it looks like:

<?xml version="1.0" encoding="UTF-8"?>
<data-depends-on-type>
<script src="https://www.xml.style/xml-file-type/basic.js" xmlns="http://www.w3.org/1999/xhtml"></script>
...
  

Each type of XML file will have a different script, so replace xml-file-type with either sitemap or opml.

Gotchas

A couple key points that I learned the hard way:

Otherwise various browsers will either fail to run the script or complain about invalid XML.

Copyright © 2026 Andrew Marcuse. All Rights Reserved. | Source | Share: