From the course: XML Essential Training
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Building content from XML
From the course: XML Essential Training
Building content from XML
- [Instructor] The previous examples of this chapter are focused on using the DOM APIs to work directly on the XML data. For this example, we're going to combine the different techniques from this chapter to create new HTML content from XML content and we're going to use the DOM APIs to do this. So let's open up DOMBuild and I've already got the code in place to load an XML file which if you haven't done the previous example, you should go back and see how this works. So I'm going to load my XML document. I've got a few functions we need to fill in to build the HTML content from the XML and we're going to start with the createCardElement function. So this function is executed when this button here in the webpage is clicked. It will read the data from the XML file which contains my BusinessCard which again, we saw this earlier in the chapter. So it's going to read that data and it's going to display it in the webpage, and we have an empty div in the webpage down here. You can see it…
Contents
-
-
-
-
-
-
(Locked)
A quick introduction to the document object model6m 57s
-
(Locked)
Inspecting document content4m 44s
-
(Locked)
Creating document content4m 51s
-
(Locked)
Loading XML from an external source4m 6s
-
(Locked)
Building content from XML6m 32s
-
(Locked)
Challenge: BusinessCard XML to HTML1m 53s
-
(Locked)
Solution: BusinessCard XML to HTML3m 52s
-
(Locked)
-
-
-
-
-
-