Chapter 14. Working with XMLIN THIS CHAPTER XML Document Structure 358 Parsing XML Documents 361 Creating XML Objects 362 Using Special Characters in XML 368 XML Namespaces 370 Validating XML 373 More XML Resources 381 Before XML, HTML, or any other standardized content markup language for communicating between computers, there was SGML (Standardized Generalized Markup Language). SGML was an open, flexible way to present content while also embedding information about the content in the same document. Unfortunately, SGML was bloated and difficult to understand. It was certainly flexible, but it wasn't easy to understand or use. For a long time, the only widely used derivative of SGML was HTML. (HTML is an SGML derivative that only specifies how a browser should render content.) In 1998, the W3C set out to solve SGML's problems while keeping its flexibility intact, and the result was the XML standard. Like SGML, XML's purpose is to describe and give structure to the content embedded in its tags, but XML does this in a simpler way. This chapter gives you a practical description of how XML is used in ColdFusion MX. We will cover just the basics of XML schemas, namespaces, and other XML concepts; an exhaustive discussion of the subject would require a book of its own. NOTE The sections in this chapter that discuss validation of XML are applicable to ColdFusion MX 7 only. Prior to CFMX 7, the only way to validate an XML document was to use a Java or COM object to perform the validation. |