Saturday, October 11, 2008

XSL Transformation (XSLT) Made Easy

Extensible Stylesheet Language Transformations (XSLT) is a language for transforming XML documents into other XML documents.

Some times testing and debugging XSLT stylesheets can be a complicated and time-consuming process. Orangevolt Eclipse XSLT plug-in provides an easy and faster way to solve the above problem.

  • XSL/XML editors for editing inside Eclipse IDE
  • Allows XML + XSL transformation (no need to run it from the application)
  • Eclipse IDE Version: 3.3 (or higher)
  • Java 2 Platform Standard Edition V1.5 or later
  • Eclipse Web Tools Platform (WTP) V2.0.1 or later; you can download the all-in-one package or download the following prerequisites:
    • Eclipse Modeling Framework SDK V2.3.1 or later
    • Java EMF Model SDK V1.2.4 or later
    • Graphical Editing Framework V3.3.1 or later
  • Download the plugin archive from:
  • Extracting the zip will create two directories: features and plugins (containing the required classes)
  • Copy these folder into your eclipse home directory: (ie. like: C:\Eclipse\)
  • Start Eclipse IDE with clean option. (eg. C:\Eclipse\eclipse.exe –clean)
  • In the Eclipse IDE Preferences, you should be able to see Orangevolt XSLT as Tree node. (Window --> Preferences)
This step confirms that the plugin has been installed successfully.

Configuring and Running:
  1. Right-click on any XSL and select "Open Run Dialog" option.
  2. On the "Run" screen, double click on "Orangevolt XSLT" tree item to create a new launch configuration.
  3. Configure the following:
    1. Project: The name of the project that you have created inside eclipse. Select the Project that contains the XSL and response xml you want to transform).
    2. Source: Specify the response xml file.
    3. StyleSheet: Specify the xsl file.
    4. Target File: Specify the output xml (this is optional, if not specified will overwrite the response xml document with the output).
  4. Click on "Run" button. It will run and transform the response xml into the output xml in the same directory where xsl is placed. You might need to refresh your Eclipse navigator view to see the created output document.

Output XML


No comments: