XSL Plugin
This is a simple plugin that lets you transform any external XML content into a XWiki page. For example it can be used to retrieve, restyle and show external RSS contents into "dynamic" panels. To work properly the plugin needs an XSL template that transforms the original source into the desired HTML code. In this plugin's distribution file you'll find an "example" directory containing a simple XSL stylesheet that transform an RSS 2.0 feed into an HTML fragment.How to use it
- First of all you need a new Wiki page, so create it.
- Now you have to attach the "example/rss2xhtml.xsl" file (included into the package) to the page.
- Go to edit the page and add the following snippet code (change the URIs with something that works ;O):
$xwiki.xslURITransformer.cachedTransformURI("http://rss.host/path/to/the/rssfeed.xml","http://your.wiki.host/xwiki/bin/download/path/to/the/attached/rss2xhtml.xsl", "900")
- Save the page and enjoy the included and reformatted rss ;O)
How does it works
The plugin uses 2 http connections to fetch the source and the xsl (that i often attach to the same page) and performs the transformation. It has 2 functions that performs the same work but in 2 different ways:- $xwiki.xslURITransformer.cachedTransformURI(SourceURI,XSLURI,Timeout)
- $xwiki.xslURITransformer.transformURI(SourceURI,XSLURI)
Final notes
- This whole package is released under Apache License.
Version 16.1 last modified by VincentMassol on 08/04/2008 at 18:24
Document data
Attachments:
No attachments for this document
Comments: 0