Thursday, November 10, 2011

XML

Why learn XML? It's easy and takes only 40-60 minutes to learn ^^ that's enough for a "WHY".

XML is designed to transport and store data.
I learn this to understand glade file created by Glade3, when writing a GUI for Python app

Some notices:


&lt; < less than
&gt; > greater than
&amp; & ampersand
&apos; ' apostrophe
&quot; " quotation mark

White-space is Preserved in XML

carriage return (CR) and line feed (LF)
XML stores a new line as LF

An XML element is everything from (including) the element's start tag to (including) the element's end tag.

no words are reserved.

Attributes are handy in HTML. In XML my advice is to avoid them. Use elements instead.
metadata (data about data) should be stored as attributes, and the data itself should be stored as elements.

Document Type Definition (DTD)

Formatting XML with CSS is not the most common method.

W3C recommends using XSLT instead
XSLT is the recommended style sheet language of XML.

XSLT (eXtensible Stylesheet Language Transformations) is far more sophisticated than CSS.

XSLT can be used to transform XML into HTML, before it is displayed by a browser:

http://www.w3schools.com/xml/xml_summary.asp

No comments: