RSS

Search Engine

Showing posts with label XSLT and Eclipse - Tutorial. Show all posts
Showing posts with label XSLT and Eclipse - Tutorial. Show all posts

Wednesday, September 15, 2010

XSLT

XSLT allows to convert XML to other format. XSLT stands for XSL Transformations. The Eclipse XSL Project allows to edit XSLT files and perform interactive XSL transformations in Eclipse.

Eclipse XSLT installation

Install the "Eclipse XSL Developer Tools" via the Eclipse Update Manager.

Your first transformation - copy

We start first with a simplest transformation possible; no transformation at all. Create a new Java project "sawan.modi.xslt.first". Create a folder "files".

Create the following XML file "source.xml" in the folder "files".

IF YOU SEE THIS CODE THEN CLICK THIS IMAGE AND ENLARGE IT.



Create the following XLS file "transform.xsl" in the folder "files" .

IF YOU SEE THIS CODE THEN CLICK THIS IMAGE AND ENLARGE IT.



Select your xsl file and run it as XSL application.

Select "Open Files..." and select "source.xml". Press ok to run it.

Review the result "source.out.xml"

Your first transformation

We want to do a real transformation. Create the following "transform2.xsl" and run it with the same input file.

IF YOU SEE THIS CODE THEN CLICK THIS IMAGE AND ENLARGE IT.


The result should look like the following.

IF YOU SEE THIS CODE THEN CLICK THIS IMAGE AND ENLARGE IT.


Thank you

Thank you for practicing with this tutorial.

I maintain this tutorial in my private time. If you like the information please help me by using flattr or donating or by recommending this tutorial to other people.