XML technologies / XML / Perl & XML / Introduction to XML
(Excerpt from "Perl & XML" by Erik T. Ray & Jason McIntosh)
XML is a revolutionary, yet also evolutionary, markup language. It combines the general power of SGML with the simplicity of freely definable markup and well-formedness rules. Its unambiguous structure and precise syntax make processing XML data with programs straightforward and pleasant.
XML lets you define a markup language tailored to your data. Instead of overloaded, presentation-oriented constructs such as those in HTML, you choose suitable element names yourself. Element and attribute declarations in a DTD even let you specify your format formally.
XML provides syntactic conveniences such as Entities as abbreviations, comments or CDATA sections to improve readability, and processing instructions to control third-party applications. Elements and attributes can be grouped through Namespaces to improve document organization. The attribute xml:space even lets you control whitespace handling, often a problem in markup languages because human readability and formal correctness can conflict.
Several useful technologies help manage and transform documents. A schema, the successor to the DTD, can validate an XML document against a canonical model. Schemas go considerably further than DTDs because they can also constrain text data, greatly improving the precision of formal specifications. XSLT is an extensive language for transforming XML documents into various output formats. There are often simpler ways to process XML, but not always.
This chapter provides a brief introduction to XML—or a refresher—covering its origins, structure, and use. Feel free to skip it if you already know XML or are eager to start programming. Just remember it is here: you may need it later.
Copyright © 2003 O'Reilly Verlag GmbH & Co. KG
You may print the online version for your private use.
Otherwise, this chapter from the book "Perl & XML" is subject to the same conditions as the printed edition: the work and all its parts are protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
O’Reilly Verlag GmbH & Co. KG, Balthasarstraße 81, 50670 Köln, kommentar(at)oreilly.de
back to top