Publishers of technology books, eBooks, and videos for creative people

Home > Articles > Web Design & Development > PHP/MySQL/Scripting

Working with XML and JavaScript

  • Print
  • + Share This
Understanding how JavaScript and XML work together is a preview of the direction of the W3C DOM and the future of JavaScript. To that end, this sample chapter describes "the XML Mystique," defines XML, and explains how to reading and show XML data with JavaScript.
This chapter is from the book

This chapter is from the book

Chapter 17: Working with XML and JavaScript


  • The XML Mystique

  • What Is XML?

  • Reading and Showing XML Data with JavaScript

The XML Mystique

The eXtensible Markup Language (XML) is one of those languages that you hear a lot about, and generally in the superlative, but not too many people are exactly sure what it is. At this point in time, both Netscape Navigator and Internet Explorer are on the verge of fully connecting JavaScript and XML using the W3C Document Object Model (DOM). Because the HTML, JavaScript, and XML DOMs are beginning to form around the same object model, you can better understand where JavaScript and HTML are headed by understanding XML.

Microsoft has provided one way of examining XML documents with IE5+ using platform-specific keywords on Windows platforms. As both NN6 and IE6 mature, working with XML will not require a separate module to load XML. So, even though limited to the Windows platform and IE5+ browser, you can see how JavaScript can be used to pull data out of an XML file and display it on the screen.

If you have ever seen stockbrokers at work on Wall Street, you might have noticed that they have several computers and monitors. What you are seeing is actually different databases being sent over different proprietary systems. Instead of needing different systems for each database, XML can put any database into a format that can be read by any computer with the right browser. At this point in time, XML is ahead of the browsers.

Because this single chapter is a scratch on the surface of XML, I highly recommend a more thorough treatment of the topic. Inside XML, by Steven Holzner (New Riders, 2001), is an excellent source of XML and has a great chapter on using JavaScript with XML. Mr. Holzner's book has more than 1000 pages that look into just about every nook and cranny of XML, and it is well worth taking a look at.

  • + Share This
  • 🔖 Save To Your Account