Downloads » Resources » [SNIPPET] xslt

[SNIPPET] xslt

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Votes: 3

[SNIPPET] xslt 0.2

by michalc

0.2 - Added option in snippet call to pass parameters to XSL sheet.
0.1.1 - Removed debugging info that was being output in error.
0.1 - Initial release.

Works with MODx Version(s): 0.9.5
Submitted: Jan 5th 2007 | License: GPL - GNU Public | Downloads: 1644

Transforms a remote XML feed using a local XSL file.

Description

This snippet can be used to transform XML news feeds, for example RSS or Atom feeds, into XHTML, using a XSL file. However, this snippet will transform any remote XML document using any local XSL file.

Parameters:
&xmlURL: URL of remote XML file to be transformed
&xslFile: Location of XSL file on the webserver
&xslParams: Comma separated list of parameterName:parameterValue pairs that are given to the XSL processor.

Example call: [!xslt? &xmlURL=`http://www.domain.com/feed.rss` &xslFile=`/assets/templates/mytemplate/testStyle.xsl` &xslParams='someExampleParameter:3,otherParemeter:yes'!]

It currently uses the PHP CURL library to retrieve a remote XML feed. It then uses the PHP DOM XML Functions to apply a XSL transformation specified in a local file to transform it into another XML document.

If you create a XSL file that you feel others may find useful, feel free to add it to the extras.

Instructions

1. Download the text file, and copy the contents into a snippet called "xslt".
2. Write or download a XSL file for the feed you wish to transform, and save it on the server.
3. In your document/chunk/template where you want the transformed XML, place a call to the snippet with the appropriate URL and file location parameters, and with the parameters (if any) that are passed to the XSL sheet.

Previous Releases

[SNIPPET] xslt 0.1.1

by michalc

0.1.1 - Removed debugging info that was being output in error.
0.1 - Initial release

Works with MODx Version(s): 0.9.5
Submitted: Jan 2nd 2007 | License: GPL - GNU Public | Downloads: 303
This resource has been deprecated.

[SNIPPET] xslt 0.1

by michalc

Initial Release

Works with MODx Version(s): 0.9.5
Submitted: Jan 2nd 2007 | License: GPL - GNU Public | Downloads: 297
Tags:
feeds, snippet, xhtml, xml, xsl
This resource has been deprecated.


Extras

First titles/links of RSS feed in unordered list

by michalc

XSL transformation that can be used with the xslt snippet to show a number of the first titles/links of a RSS feed.

Works with MODx Version(s): 0.9.5
Submitted: Jan 2nd 2007 | License: GPL - GNU Public | Downloads: 845
Tags:
feeds, other, xhtml, xml, xsl

( back to top )