Introduction to XML
by K. Yue
1. Introduction
- XML stands for eXtensible Markup Language.
- XML is a system for defining, validating, and sharing documents.
- Main standard organization: World Wide Web Consortium (W3C), http://www.w3.org/XML/.
- XML uses:
- Elements for document structures
- Attributes to describe their properties
- XML is a meta-language. It is used to define languages. Example, HTML, MathML, etc.
Example:
<?xml version="1.0"?>
<memo priority="very high">
<from empId='1012345'>Bun Yue</from>
<to>Everybody</to>
<body>
Hello, welcome!
</body>
</memo>
- The elements and attributes provide meaning to the content.
Some Advantages of XML:
- Strict syntax with unambiguous structures for simpler and more meaningful processing.
- Better modeling of application domain.
- Validation for early error checking.
- Extensible to fit requirements of different domains.
- Human readable and easy to understand.
- Vigorous standards and wide adoption.
- Abundance of tools.
Some disadvantages of XML:
- Verbose
- Text-based
- Tree-based structures may not fit specific application natures.
- Not object-oriented
Example:
The popular JSON (JavaScript Object Notation) uses a name-value pair notation, not XML.
Core XML Standards
See http://www.w3.org/XML/.
- XML Specification: XML syntax.
- XML Namespace: defining address spaces to avoid naming conflicts.
- DTD (Document Type Definition): an old standard for specifying grammars of XML vocabularies.
- XML Schema: a newer and much more powerful way to define XML grammars that is itself in XML format.
- XLink: linking between XML documents.
- XPointer: referring to parts of an XML document.
- XPath: searching an XML document.
- XQuery: XML query language in the line of SQL.
- CSS (Cascading Stylesheet): a style sheet standard for viewing XML and HTML.
- XSL (eXtensible Stylesheet Language): for displaying and transforming XML documents
- XSLT: the XSL part for XML transformation.
- FO: formatting object, the display part of XSL.
- DOM (Document Object Model): W3C standard for object and interface collections for manipulating XML documents (and HTML, etc).
XML Tools and Technology
- XML Editors
- XML Parsers
- DOM: create a document object (tree based)
- SAX: event-driven
- Querying:
- XML Server:
- serve XML Data source management Transformation
- Consumption support, e.g. RESTful (REpresentational State Transfer)
- XQJ API (XQuery API for Java)
- Content and subscription management XML
- XML DB: storage of collection of XML documents.
XML DB
- Persistence and efficient access of collections of XML documents.
- XML Enabled DB:
- DB provides features for production and consumption of XML.
- Underlying storage may not be in XML format: e.g. relations.
- Native XML DB:
- XML document as the basic data model.
- XML document as a fundamental storage unit.
- Standalone or not.