From the course: XML Essential Training

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Repeating items

Repeating items - XML Tutorial

From the course: XML Essential Training

Start my 1-month free trial

Repeating items

- [Instructor] With this example, we'll start examining some of the more powerful parts of XSLT by working with repeating sets of data. So let's open the repeating items XML file and you can see that this a file that has a root tag of items, and underneath items, I've got four individual item tags, each of which has some subtags. So you can see that this is a basic XML document that contains information about various kinds of coffees and teas and each item has an attribute indicating whether it's available or not. As well as a partial URL to an associated photo and those photos are located in this directory right here. So let's also open up the repeating items XSLT file. Here we have our stylesheet declaration. And here's our template. And this template is going to match whatever the root tag of the source XML document is. I don't specify items here, just says "whatever the root tag is, match that." So you can also see the template contains HTML code, so I'm going to be transforming…

Contents