core Estimated learning time: 8 h

OE1-5.3 XML & JSON

You can write well-formed XML with correct document structure, namespaces and schemas, display XML raw and with CSS, and compare XML with JSON.

XML and JSON solve the same problem — moving structured data between systems that share no code — and comparing them is the point of the unit. XML is verbose and carries schemas, namespaces and validation; JSON is terse and maps directly onto the data structures of most languages, which is why it won for web APIs. Namespaces exist for a genuine reason worth understanding: when two vocabularies are combined in one document, names collide.

Work through these

  • Introduction to XML and its uses

    A general way of marking up structured data, and why anyone wanted one. Its main use now is in configuration and in older systems, which is worth saying plainly.

  • The syntax of XML

    The rules a document must obey to be readable at all. Being strict is the whole point: a parser refuses rather than guessing.

  • XML document structure

    How a document is organised, from the declaration to the single root. It is short and it prevents a lot of confusion.

  • Namespaces and why they exist

    Avoiding name collisions when two vocabularies are combined. It is the item that looks like bureaucracy and turns out to be necessary.

  • XML schemas

    Declaring what a valid document looks like, so it can be checked automatically. Validation is the strongest argument for this format over the alternative below.

  • Displaying raw XML documents

    What a browser does with a document that has no styling. It shows the structure, which is a useful debugging habit.

  • Displaying XML documents with CSS

    Applying the styling from the first topic to structured data. It demonstrates the separation of content from presentation in a second setting.

  • JSON

    The lighter alternative, which is what almost every modern interface actually uses. Its mapping onto the language's own data types is why it won.

  • XML versus JSON

    The comparison, which is the item the topic exists for. One validates and describes; the other is compact and immediate, and knowing when each is right is the takeaway.

Sign in to keep your progress.

Free resources

We haven't checked most of these for screen reader use yet.

Links last checked 30 Aug 2026.

Stuck here?

Ask a mentor. A real person answers, and they can see exactly which topic you're on. Usually within a couple of working days.

Checking your session…

Topics shown in module order.