Basics of XML
Monday, March 29, 2010
1:21 PM
Basics of XML
Every XML document contains a single element
<foo>
</foo> 
that can contain sub-elements. 
Elements can have attributes, e.g., 
<bar name='Marvin'> Beer </bar> 
has
element 'bar'
attribute name has value'Marvin'
content 'Beer'
XML and HTML: new rules: 
All elements must be closed: 
<br> => <br></br>
All attributes must be quoted strings (with " or ') 
<ol type=a> => <ol type="a"> or <ol type='a'>
A shorthand
<cat/> means <cat></cat> 