XML Basics
XML (Extensible Markup Language) is the industry standard for the interchange of data. Be aware of the following about XML:
- XML is a universal language for the representation of data.
- XML facilitates sharing data between computers across a network, software applications, databases, etc.
- XML is plain text, easy to read, create, and parse.
- XML data is stored as Unicode UTF-8.
- XML is an open standard that anyone can use.
- XML is not a data presentation language like HTML. It only describes the data, not the layout or format of the data.
XML is a self-describing tagged markup language and a subset of SGML. The following table describes the components of XML.
| Component | Description |
| XML Declaration | The XML declaration is typically the first line in an XML document.
|
| Elements | XML elements are tagged sections of data.
Some Data;
|
| Attributes | Attributes reside inside a tag and are used to describe the data.
Some Data;
|
| Data | Data is stored between element opening and closing tags. It is in plain text, usually UTF-8 Unicode.
Some Data; |
| Comments | Comments are elements that are not read as data or otherwise displayed.
|
To be valid, XML must be well-formed; that is it must adhere to the following rules:
- The document must have exactly one root element.
- Elements must be open and closed in the same context. In other words, elements must be nested without overlapping opening and closing tags.
- Each element must have an opening tag and a closing tag or else be self-closing.
- Data must appear inside elements.
XML allows for a description of the XML document itself to be created called a schema. A schema describes a contract that both the transmitter and the receiver of the XML document agree to follow. While the XML document holds the data, the schema defines the structure of that data. It is the schema that allows both parties to understand fully what the tags and attributes mean and defines the context that the data structure is allowed within the XML document. XML schemas are used to create thousands of XML-based languages in use today. Some of these languages include SOAP, WSDL, and many other open source and proprietary languages.
Digg it | Save to del.icio.us | Netscape | Reddit | Stumble It!
- - - - - S P O N S O R I N G A D V E R T I S M E N T - - - - -