Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

XSLT transformation is used in WSO2 DSS to transform the result of an already defined operation into a different result. The user can define the transformation xslt and provide the url of the transformation file in the result element.

Table of Contents
maxLevel3
minLevel3

Introduction

...

About the sample

The sample data service (ExcelSampleService), which we use for this demonstration consists of two operations:

  • getProducts - Lists all the products that are manufactured in the company. Each record in the result contains "ID" and "Name" fields. 
  • getProductClassifications - Lists all the products along with the classifications. The result will consist of two records, "Name" and "classification". However, note that because of the xslt transformation, the actual output of this operation has changed to "product-Name" and "product-classification". 

See Data Services and Resources for a definition of data services and operations.

Building the sample

The sample data service named ExcelSampleService should be deployed using the instructions in Samples Setupsection.

Running the sample

The sample service can be run using the TryIt tool, which is bundled with the WSO2 Data Services Server, or a code-generated java client sample as discussed in the Data Services Clients section.

Service description

The Excel sample data service contains two operations "getProducts" to list all the products that are manufactured in the company, each result record will contain "ID" and "Name" fields. And "getProductClassifications" where to list all the products along with the classifications, which contains two result records which are "Name" and "classification".

Second operation's ("getProductClassifications") actual output has changed as "product-Name" and "product-classification" by using the xslt transformation.

Sample run

Sample run of the service using the TryIt tool is shown below.

Image RemovedFollow the steps below to demonstrate this functionality using the TryIt tool:

  1. Log in to the management console of your server and click List under Services in the navigator. The ExcelSampleService will be listed here.
  2. Click Try this service to open the TryIt tool.
  3. Select "getProductClassifications" operation and click Send to execute. You will get the response as shown below.
    Image Added