wiki:XMLIntroduction

Version 2 (modified by Klaus Thoden, 9 years ago) (diff)

--

Introduction

This is an introductory text to XML, the extensible markup language used for our texts.

There is also the W3C Recommendation.

Basic facts about XML

  • An XML document is a plain text file, preferably in Unicode encoding
  • The structure is made up out of nested elements, like a matroshka.
     <root>
        <nestedElement>With content</nestedElement>
        <anotherElement with="attribute" another='one'>Elements can have attributes </emptyTag>, as well</anotherElement>
        <!-- I am a comment <hidden>everything here is</hidden> ignored -->
        <question>did we already talk about &amp; entities?</question>
     </root>
    
    As with a matroshka, also in XML, you cannot put half a puppet into the bigger puppet: they have to be properly nested. Some characters are forbidden, they have to be escaped:
    • <: &lt;
    • >: &gt;
    • &: &amp; To a lesser extent, namely only in attribute values
    • ": &quot;
    • ': &apos;