View System Documentation - Content Management - XML Basics
What XML Is
- XML stands for eXtensible Markup Language
- XML is a markup language much like HTML (data in between tags example <tag>my data</tag>
- XML is a markup meta-language. A framework for defining other markup languages
- XML was designed to describe data (not how to present it)
- XML tags are NOT predefined. You must define your own tags
- In some cases it is a replacement for EDI
What XML Is Not
- Able to do anything on it's own. It is just plain text with some sort of tag that enclose the data so it can be differentiated from other data.
- Able to define how your data is to be shown. To show data, you need other techniques.
- Able to easily deal with binary data like gifs, jpegs, old MS-Word documents, MS-Excel documents etc.
- A replacement for HTML
- A replacement for relation databases
- A Silver Bullet
XML Basics
- XML files must begin with the XML declaration (prologue)
- Must have one unique root container element.
- All elements must have an opening and matching closing end-tag
- Blank/Empty elements can be coded in a single tag syntax. Example: <MY_TAG_NAME/>
- XML element names and attribute names are case sensitive
- All elements must be properly nested/well formed
- All attribute values must be quoted
- Use the CDATA element for absolute text contents are desired
- HTML comments are supported. Example: <!-- a comment block -->
- XML Namespaces provide a method to avoid element name conflicts. Most XML
extension technologies (like SVG, XSLT, XINCLUDE) utilizes a namespace to
ensure that their elements do not conflict with contained elements.
An example of an "ibis:" namespace is the ibis include element
which looks like: <ibis:include href="somedir/somefile.xml"
xmlns:ibis="http://www.ibisph.org"/>.
IMPORTANT: When a file contains any namespace type element that element or one of its parent elements MUST have a "xmlns:" attribute declaration. In the case of the "ibis:" namespace this would look like this (again an attribute of the current element or a parent element): xmlns:ibis="http://www.ibisph.org". The value of the attribute can be anything unique and must be consistent throughout the file (the URL value is NOT validated/verified so it can be anything just unique and consistent).
XML Resources
- www.w3schools.com is a good all around website that provides tutorials, examples, and reference material for most web related technologies
- Microsoft's XML Developer Center contains the latest news, blogs, great references and examples
- A good XML technologies overview can be found at The XML Revolution Technologies for the future Web