Tutorial by Examples

Elements come with angle brackets are the most prominent building block of XML. Elements can either be empty, in which case they are made of an empty tag (notice the ending slash): <an-empty-element/> Or they can have content, in which case they have an opening tag (no slash) and a closin...
Attributes are name-value pairs associated with an element. They are represented by values in single or double quotes inside the opening element tag, or the empty element tag if it is an empty element. <document> <anElement foo="bar" abc='xyz'><!-- some content -->&l...
Text is made of all characters outside of any markup (opening element tags, closing element tags, etc). <?xml version="1.0"?> <document> This is some text and <b>this is some more text</b>. </document> The precise XML terminology for text is character...
Comments in XML look like so: <!-- This is a comment --> They can appear in element content or top-level: <?xml version="1.0"?> <!-- a comment at the top-level --> <document> <!-- a comment inside the document --> </document> Comments canno...
A processing instruction is used to directly pass on some information or instruction to the application via the parser. <?my-application some instructions ?> The token after the initial question mark (here my-application) is called the target and identifies the application at which the ins...

Page 1 of 1