O'Reilly logo

BPEL and Java Cookbook by Jurij Laznik

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the xsl:for-each command

In this recipe, we will examine the usage of the for-each command in XSLT. This function is helpful when we need to transform a number of identical elements in the array. We will use the for-each command to map (transform) the list of the available cars.

Getting ready

We will modify the example from the The chaining functions recipe. For our recipe, we will define a new schema to show how the for-each command works. We define a schema that presents a list of the available cars to be rented. The schema is as follows:

 <xsd:element name = "WScars"> <xsd:complexType> <xsd:sequence> <xsd:element name = "listCars" maxOccurs = "unbounded"> <xsd:complexType> <xsd:sequence> <xsd:element name = "carType" type = "xsd:string"/> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required