源代码:
下载代码
AI 编程工具
点击运行
<!DOCTYPE html> <html> <head> <script src="loadxmldoc.js"> </script> </head> <body> <script> xmlDoc=loadXMLDoc("books_ns.xml"); x=xmlDoc.getElementsByTagName('title'); for(i=0;i<x.length;i++) { document.write("Prefix: " + x.item(i).prefix); document.write("<br>"); document.write("Local name: " + x.item(i).localName); document.write("<br>"); document.write("Namespace URI: " + x.item(i).namespaceURI); document.write("<br>"); document.write("Base URI: " + x.item(i).baseURI); document.write("<br>"); document.write("<br>"); } </script> </body> </html>
运行结果: