XML 101
XML Parsers
XML Structure

XML reserved character
Entiry reference
XML Entities
Last updated

Last updated
<?xml version="1.0" encoding="UTF-8"?> <!-- XML declaration -->
<contacts> <!-- start tag of the contacts element -->
<contact id="123"> <!-- element attributes are defined within the start tag -->
<firstName>Tom</firstName> <!-- sub-element of contact -->
<lastName>Jones</lastName>
</contact>
<contact id="456">
<firstName>Tom</firstName>
<lastName>Petty</lastName>
</contact>
</contacts> <!-- end tag of the contacts element --><![CDATA[ content ]]><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE note [
<!ENTITY sender "x7331">
]><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE note [
<!ENTITY senderPrivate SYSTEM "http://example.com/note.txt">
<!ENTITY senderPublic PUBLIC "public_id" "http://example.com/note.txt">
]><?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE note [
<!ENTITY % name SYSTEM "URI">
]><!-- defining a parameter entity -->
<!ENTITY % name 'x7331'>
<!-- defining an internal entity which includes a parameter entity -->
<!ENTITY Title 'This is the site of %name;'><name>&name;</name>