From the course: XML Essential Training

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

Repeating items

Repeating items

- [Instructor] Let's examine some of the more powerful parts of XSLT by working with repeating sets of data. So I'm going up to open up the repeating_items.xml file and in this XML file, I have a root tag named items and under items, I have four item tags that represent products for our Java Code Tea Company. So each of the item tags contains some product information such as the name, product type, a URL for the photo, and the photos are contained in this directory right here. Each item also has an attribute indicating whether it is currently available. So let's open up the repeating_items/xslt file. So here we have our style sheet declaration and our template. The template is going to match the root items tag and the template is generating some HTML content. What I'm going to do is use the for-each tag in my template to build up an HTML structure for each of these items elements. So I'll add that code here and what I'm going to do is put in xsl for-each, and then I have a select…

Contents