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
From the course: XML Essential Training
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
-
-
-
-
-
-
-
-
-
(Locked)
What is XSLT?4m 10s
-
(Locked)
Defining XSLT style sheets3m 35s
-
(Locked)
Simple XSLT4m 6s
-
(Locked)
Repeating items5m 13s
-
(Locked)
Conditional logic6m 47s
-
(Locked)
Sorting data2m 24s
-
(Locked)
XSLT in the browser6m 26s
-
(Locked)
Challenge: BusinessCard XSLT2m 44s
-
(Locked)
Solution: BusinessCard XSLT1m 57s
-
(Locked)
-
-
-