XML

From Wikicliki
Revision as of 10:16, 17 September 2008 by WikiSysop (talk | contribs)

Jump to: navigation, search

The diference between XML and HTML is that XML was designed to transport and store data, while HTML was designed to display data.

XML does not do anything. It merely holds information. It has no predefined tags. You invent your own tags in XML. Its not a replacement for HTML, which can only use HTML tags, and is meant to display information and format it in pretty ways.

well formed XML:

  1. XML elements must be properly nested and not overlap
    • CORRECT: <title> Romeo and Juliet <author> Shakespeare </author> </title>
    • WRONG: <title> Romeo and Juliet <author> Shakespeare </title> </author>
  2. Empty elements may contain attributes
    • All the following are correct:
    • <food name="orange" state="decomposing"></food>
    • <food name="orange" state="decomposing" />
    • <food name="orange" state="decomposing"/>


XPath

XPath may be used to compute values (strings, numbers, or boolean values) from the content of an XML document.