| 4 | |
| 5 | There is also the [http://www.w3.org/TR/xml/ W3C Recommendation]. |
| 6 | |
| 7 | == Basic facts about XML == |
| 8 | * An XML document is a plain text file, preferably in Unicode encoding |
| 9 | * The structure is made up out of nested elements, like a matroshka. |
| 10 | {{{ |
| 11 | <root> |
| 12 | <nestedElement>With content</nestedElement> |
| 13 | <anotherElement with="attribute" another='one'>Elements can have attributes </emptyTag>, as well</anotherElement> |
| 14 | <!-- I am a comment <hidden>everything here is</hidden> ignored --> |
| 15 | <question>did we already talk about & entities?</question> |
| 16 | </root> |
| 17 | }}} |
| 18 | As with a matroshka, also in XML, you cannot put half a puppet into the bigger puppet: they have to be properly nested. |
| 19 | ** Some characters are forbidden, they have to be escaped: |
| 20 | - {{{<}}}: {{{<}}} |
| 21 | - {{{>}}}: {{{>}}} |
| 22 | - {{{&}}}: {{{&}}} |
| 23 | To a lesser extent, namely only in attribute values |
| 24 | - {{{"}}}: {{{"}}} |
| 25 | - {{{'}}}: {{{'}}} |
| 26 | |