Chapter 11. XML and E4X
FEATURED CLASSES
XMLXMLListQNameNamespace
ActionScript 3.0 includes thorough, language-level support for XML. Not only can you create, load, and parse XML, you can write XML literals directly into ActionScript 3.0 code. A robust XML manipulation and query language, E4X, provides you with the tools to quickly and easily get the information you need. E4X, too, is implemented at the language level to make XML manipulation succinct.
Getting Started with XML in ActionScript
XML—the eXtensible Markup Language—is a format for storing any kind of hierarchical data. It has universal adoption and countless uses. XML is designed to be minimal; as the name extensible implies, you can design your own language that uses XML for its general structure but adds on more specific grammar.
XML References
This chapter assumes a basic knowledge of XML's structure and syntax. If you are unfamiliar with XML, you may want to check out the W3C Schools XML Tutorial (http://www.w3schools.com/xml/), the Wikipedia entry on XML (http://en.wikipedia.org/wiki/XML), or one of the many books available on XML. Let's agree on some terminology:
<?xml version="1.0" encoding="UTF-8"?>
<parentNode>
<childNode attributeName="Attribute Value">
Node Content
</childNode><childlessChildNode/> <!-- comment --> </parentNode>
The XML document begins with the document declaration and contains exactly one root node—parentNode here. Data is represented by nodes, or elements—parentNode and childNode—enclosed within ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access