-- Learning not just technology, but dreams!
Home HTML JAVASCRIPT CSS VUE REACT PYTHON3 JAVA C C++ C# AI GO SQL LINUX VS CODE BOOTSTRAP GIT Local Bookmarks
XML Tutorial
XML Tutorial
XML Introduction
XML Uses
XML Tree Structure
XML Syntax
XML Elements
XML Attributes
XML Validation
XML Validator
XML Viewing
XML CSS
XML XSLT
XML JavaScript
XML HTTP Request
XML Parser
XML DOM
XML/HTML
XML Applications
XML Advanced
XML Namespaces
XML CDATA
XML Encoding
XML Server
XML DOM Advanced
XML Considerations
XML Technology
XML Real-world Examples
XML Editor
XML E4X
XML Summary
XML Examples
XML DOM
XML Applications
Deep Dive
Programming
Scripting Languages
Development Tools
script
Scripts
Web Services
Web Design and Development
Web Service
Computer Science
Programming Languages
HTML Page Displays XML Data
Displaying XML Data in HTML Pages
In the following example, we open an XML file ("cd_catalog.xml"), then iterate through each CD element and display the values of the ARTIST and TITLE elements in an HTML table:
Example
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","cd_catalog.xml",false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;
document.write("
");
var x=xmlDoc.getElementsByTagName("CD");
for (i=0;i<x.length;i++)
{
document.write("| ");
document.write(x.getElementsByTagName("ARTIST").childNodes.nodeValue);
document.write(" | ");
document.write(x.getElementsByTagName("TITLE").childNodes.nodeValue);
document.write(" |
");
}
document.write("
");
Try it »
For more information on using JavaScript and XML DOM, please visit our XML DOM Tutorial.
XML DOM
XML Applications
ByteArk Coding Plan
Supports mainstream large models like Doubao, GLM, DeepSeek, Kimi, MiniMax, officially supplied, stable and reliable.
Configuration Guide
¥9.9
/ month
Activate Now
iFlytek Star Coding Plan
Includes free model call quota, DeepSeek, GLM, Kimi, MiniMax, one-stop experience and deployment platform.
Configuration Guide
¥3.9
/ month
Activate Now
Click to Share Notes
Category Navigation
Python / Data Science
AI / Intelligent Development
Front-end Development
Back-end Development
Database
Mobile Development
DevOps / Engineering
Programming Languages
Computer Fundamentals
XML / Web Service
.NET
Website Building
Advertisement
XML Tutorial
XML Tutorial
XML Introduction
XML Uses
XML Tree Structure
XML Syntax
XML Elements
XML Attributes
XML Validation
XML Validator
XML Viewing
XML CSS
XML XSLT
XML JavaScript
XML HTTP Request
XML Parser
XML DOM
XML/HTML
XML Applications
XML Advanced
XML Namespaces
XML CDATA
XML Encoding
XML Server
XML DOM Advanced
XML Considerations
XML Technology
XML Real-world Examples
XML Editor
XML E4X
XML Summary
XML Examples
Online Examples
·HTML Examples
·CSS Examples
·JavaScript Examples
·Ajax Examples
·jQuery Examples
·XML Examples
·Java Examples
Character Sets & Tools
· HTML Character Set Settings
· HTML ASCII Character Set
· JS Obfuscation/Encryption
· PNG/JPEG Image Compression
· HTML Color Picker
· JSON Formatting Tool
· Random Number Generator
Latest Updates
· Codex Advanced Configuration
· AI Agent Terminology
· ZCode Getting Started Tutorial
· Loop Engineerin...
· Claude Code Us...
· Claude Code Us...
· docker compose ...
Site Information
· Feedback
· Disclaimer
· About Us
· Article Archive
Follow WeChat
My Favorites
Mark Article
Browsing History
Clear All
No records yet