O'Reilly logo

JavaScript® Bible, Seventh Edition by Paul Novitski, Danny Goodman, Tia Gustaff Rayl, Michael Morrison

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 39. Ajax, E4X, and XML

IN THIS CHAPTER

  • Treating XML elements as objects

  • Creating XML data islands

  • Accessing XML element attributes

  • Using the XMLHttpRequest object

  • Using E4X to create dynamic XML objects

XML (eXtensible Markup Language) is an undeniably hot topic in the Internet world, and has been for the past few years. Not only has the W3C organization formed multiple working groups and recommendations for XML and its offshoots, but the W3C DOM recommendation also has XML in mind when it comes to defining how elements, attributes, and data of any kind—not just the HTML vocabulary—are exposed to browsers as an object model. Most of the arcana of the W3C DOM Core specification—especially the structure based on the node—are in direct response to the XML possibilities of documents that are beginning to travel the Internet.

ECMAScript for XML (E4X) is a standardized programming language extension that provides native XML support to ECMAScript as a primitive type, at the same level as strings, numbers, and Booleans. It has been supported since FireFox 1.5, but is not supported as of Safari 4.0.4, Google Chrome 4.1.249.1045, Opera 10.51, or IE 8.

During its early explorations into XML and browsers, Microsoft devised a custom HTML element—the <xml> tag—that allowed authors to embed XML data into an HTML document. These tags created what were called XML data islands. A more practical solution came slightly later with the creation of an ActiveX control that could retrieve XML data (from ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required