This module adds a field formatter that transforms XML content using an XSL stylesheet before displaying it. It can process XML from a text area, a linked URL, or an uploaded file, allowing you to configure different XSL transformations for each field.
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 text (plain, long) 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
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/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.
Ask your assistant about XSL Formatter
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.
Activity
Releases
| Version | Type | Core | PHP | Release date | |
|---|---|---|---|---|---|
| 2.0.0 | Stable | 8–11 | Oct 28, 2026 | ||
| 2.0.0-alpha1 | Pre-release | 8–10 | Oct 24, 2023 |