XML Applications


This section shows how HTML can be used with XML, HTTP, DOM, and JavaScript for different purposes.


The XML Document Used

In this section, we'll work with a file named "cd_catalog.xml" in XML format.


Display XML Data in an HTML Table

This example goes through each CD element and shows the information from the ARTIST and TITLE elements in an HTML table.


Display the First CD in an HTML div Element

This example shows how a function is used to reveal the initial CD element within an HTML element tagged with id="showCD".


Navigate Between the CDs

To move between the CDs shown above, make a function called next() and another one called previous().


Show Album Information When Clicking On a CD

The final example demonstrates displaying album details when the user clicks on a CD.