📄

XML Beginner

Structured data markup — well-formedness, elements and attributes, validated live.

3 lessons 7 tasks ⚡ Live compiler
Lessons Compiler Quiz Certificate

📚 Lessons

1 Elements and attributes

XML stores hierarchical data in custom tags. Every element must be closed and properly nested. Attributes add metadata inside the opening tag.

<?xml version="1.0" encoding="UTF-8"?>
<book id="b1">
  <title>The Pragmatic Programmer</title>
  <author>Andrew Hunt</author>
  <year>1999</year>
</book>

2 Well-formedness rules

An XML document is well-formed when it has a single root, all tags are closed, tags are correctly nested and attribute values are quoted. The playground validates this for you.

<catalog>
  <product sku="A1">
    <name>Keyboard</name>
    <price currency="EUR">49.90</price>
  </product>
  <product sku="A2">
    <name>Mouse</name>
    <price currency="EUR">19.90</price>
  </product>
</catalog>

3 Nesting and data modelling

XML models trees. Repeated child elements represent lists; nesting represents containment. It is widely used for configuration, RSS, SVG and document formats.

<team name="Falcons">
  <player number="7">
    <name>Mara</name>
    <position>Forward</position>
  </player>
  <player number="4">
    <name>Ivo</name>
    <position>Defender</position>
  </player>
</team>

⚡ XML Compiler

Your XML is validated for well-formedness and rendered as a tree.

XML

            

📝 Tasks

7 tasks across 3 pages — multiple-choice and fill-in (type the answer). Score 70% or higher to earn your certificate.

🎓 Certificate of Completion

🔒 Pass the quiz above (70%+) to unlock your downloadable certificate.