A field formatter that runs given XML content (pasted data, linked URL or uploaded file) through a defined XSL stylesheet before rendering.
When enabled, this provides an additional field formatter available through 'manage display' for use entity displays or views. The result is then shown in the page and managed like any other field display.
The data source can be:
- a textarea field which contains the raw XML.
- a link field defining a remote or filesystem data source.
- A file field where you can upload an XML file directly.
Configuration options on the display widget will allow you to choose or upload the XSL that should be run over it, on a per-field basis.
(If you want different options per entity, try adding formatter_field)
Upload your own XSL files using the upload field on the formatter settings or re-use the ones already available. It comes with three 'XML Pretty-printers' as samples to begin with, but you should source your own ones for your own data.
Process the contents of a remote URL
This process can ALSO run identically over a link field.
Add a 'link' field to your page, and choose 'Transformed by XSL' as the renderer.
On each request, that file will be fetched, parsed, transformed and rendered.
The data source (textarea or link target) should contain valid XML, and the XSL should produce an HTML snippet, as the result will be displayed inline in the page.
This remote fetcher could be used to provide an inefficient type of RSS-like update, this could also display realtime data from remote feeds of many types, such as weather data, movie screenings, bus timetables etc, as long as it comes in XML and you can write an XSLT for it.
For a really robust solution like that, please use Feeds module instead. However, as a stand-alone only-one-configuration-setting-needed version, this could be handy too.
Other projects
See also:
-
http://drupal.org/project/cck_xslt D6 unreleased
- which made its own field and data storage instead of re-using a text field.
- Has the XSL selection a per-node choice, not a field formatter.
- did demonstrate how easy it was to extend to reading an URL instead of text. -
http://drupal.org/project/feeds_xsltparser D7 dev
- Not incredibly similar, but nice to see! -
http://drupal.org/node/1476774 "XML Transform" Never released
- Uses the Drupal text filter system to process a textarea with XSL.
- Actually the first way I started thinking about it, as I've done multiple XML-based text filters already.
Drupal6 Backport exists
... However the additional options : XSL parameter input and direct file upload are unavailable as there is no D6 UI for this under CCK. Instead,
- place your own files in {site}/files/xsl and flush the cache.
- Each available xsl file found will be an available transform process, select it from the cck field display management page.
@author Dan Morrison (dman) dan@coders.co.nz
@version 2012-11-27 (1:00AM -3:30AM)
Project information
- Project categories: Content display, Site structure, Import and export
15 sites report using this module
- Created by dman on , updated
Stable releases for this project are covered by the security advisory policy.
There are currently no supported stable releases.
Releases
Drupal 10 compatibility




