XML Cheat Sheet
I stumble across XML documents intermittently and every time I need to review the basics again. This is a cheat sheet so that I can review it whenever I need to. This is a summarized form of the XML Tutorial.
Also see the following related cheat sheets :
What is XML
XML uses text files to store data and can be used to create new languages e.g. WAP, WML, XHTML, RSS, SOAP etc.
XML Syntax
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE note SYSTEM "InternalNote.dtd">
<note date="12/11/2002">
<to>Alice</to>
<from>Bob</from>
<par>Hi.</par>
<par>Bye.</par>
</note>
XML Validation
XML Elements
XML Attributes
XML Namespaces
<h:table xmlns:h="http://www.w3.org/TR/html4/">
<h:tr>
<h:td>Apples</h:td>
<h:td>Bananas</h:td>
</h:tr>
</h:table>
The xmlns
URL is not used but often points to an informational web page.
XML Stylesheets
Cascading
Style
Sheets (
CSS) are used to display XML by associating styles with element types.
<?xml-stylesheet type="text/css" ref="simple.css"?>
CSS is deprecated in favour of XSL.
XML
Stylesheet
Language is the preferred formatting language for XML. It is a more sophisticated and powerful replacement for
CSS.
<?xml-stylesheet type="text/xsl" href="simple.xsl"?>
Assorted
An XML data island is XML data embedded into an
HTML page.
A
Uniform
Resource
Identifier (
URI) is a string of characters which identifies an Internet Resource. The most common
URI is the
Uniform
Resource
Locator (
URL) which identifies an Internet domain address. Another, not so common type of
URI is the
Universal
Resource
Name (URN).