Extension:XmlOutput

From MediaWiki.org

Jump to: navigation, search
Manual on MediaWiki Extensions
List of MediaWiki Extensions
XmlOutput

Release status: beta

Implementation Special page
Description Allows articles containing XML to be returned as raw XML with associated XSLT applied if required
Author(s) User:Nad
Version 1.0.0 (2007-09-10)
MediaWiki > 1.6.0
Download XmlOutput.php

This extension allows you to request an article containing XML to be returned as raw XML with the MIME type of application/xml. Also any XSLT stylesheet referred to in the XML will be applied before the file is returned. The XSLT's should also be an article in the wiki and referred to by article title in any stylesheet links within the XML.

If the XSLT needs to refer to other XML articles in the wiki for example with the document() function, then it should do so with an absolute URL using the special page, for example:

http://www.foo.bar/wiki/index.php/Special:XML/foobar.xml

Note: XSLT doesn't like query strings in URL's passed to the document function, so be sure to use a URL similar to this example which avoids the use of a query-string.

[edit] Installation

To install, copy the code from OrganicDesign:Extension:XmlOutput.php and save into a file in your extensions directory or a subdirectory thereof if you prefer. Then include the file from within your LocalSettings.php file as usual.

[edit] Todo

  • Allow local or remote resources to be specified for associated XSLT's
  • Add error reporting if parsing or processing problems
  • Cater for XSLT output methods other than "xml"
Personal tools