From the course: XML Essential Training

Unlock the full course today

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

XSLT in the browser

XSLT in the browser

- [Instructor] The examples that we've worked with so far in this chapter have been standalone XML files. In this example, we're going to use XSLT to transform XML directly in the client side browser using JavaScript. So, let's open the clienttransform.xml and the XSLT source files. So, the XML data is the same product data that we've been working with, and the XSLT stylesheet transforms the XML into an HTML table element. It's not a full HTML structure, it's just the table. So, we're going to take this result and put it into our HTML file. The table will display the item photo, the name and the product type for each item in the XML. The table body section is being built using a for-each tag, which we learned about earlier. So this loop builds a table row for each item element in the XML source data, and each row contains three table cells, an image, the product name, and the product type. Now so far, this should all look familiar to you based on the work we've done up to this point…

Contents