[Qgis-developer] XSL transformation for Qgis repo XML files

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Sun Jun 22 11:25:23 EDT 2008


   I was having some trouble installing a plugin from the installer, so I
figured I'd download the source zip file. So I got the repo XML file,
found the plugin, cut n pasted the URL into my browser, downloaded and
there it was.

   Which was a bit of a faff really  :)

   So I figured with a bit of XSL and CSS magic I could make the XML repo
files display nicely in Firefox and other browsers (what?!, there's
other browsers???).

   First, repo managers need to make sure their xml files have a proper
XML header and an xml-stylesheet tag. This doesn't affect the way QGIS
parses the file:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<?xml-stylesheet type="text/xsl" href="plugins.xsl" ?>

   That's all you need to do to the .xml file.

   Then put a plugins.xsl file where that href will find it. Put it
anywhere but make sure the href in the stylesheet tag points to it.

   I've attached a plugins.xsl that I wrote. It just shows each plugin in
a nice box with a link to the file and the homepage. Here's how my
rather scanty repo looks with it:

http://www.maths.lancs.ac.uk/~rowlings/Qgis/Plugins/plugins.xml

   You can also download the plugins.xsl from there if the attachment
fails to get through the mailing list. Feel free to customise the
plugins.xsl to express your personality.

   One thing I'd like to see is some attributes for the <plugins> tag, to
specify the repository perhaps, so I could do: <plugins repo="Barry's
Plugins">. Might be useful for presentation purposes and including in
the plugin loader.

   Feel free to use this technique or not - I'm just filling in time
between household chores on a rainy Sunday. Or finding excuses to avoid
said chores...

Barry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: plugins.xsl
Type: text/xml
Size: 1654 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/qgis-developer/attachments/20080622/266fc666/plugins.xsl


More information about the Qgis-developer mailing list