XML·XML from well-formed documents to XSLT

XML versus JSON

Choose the format that fits the data and the consumers.

Beginner 13 min read Lesson 10 of 300 Challenge included
What you will be able to do
  • JSON is simpler for APIs.
  • XML handles mixed content and namespaces.
  • Both need validation at boundaries.
  • Do not convert formats just for fashion.

In plain English

JSON is smaller and maps directly to common language types. XML supports mixed content, namespaces, schemas and mature document tooling. Use JSON for APIs and XML for documents, feeds and legacy integrations.

compare.txtHTML
JSON: {"title":"CSS","minutes":18}
XML:  <lesson minutes="18"><title>CSS</title></lesson>
Your turn

Choose a format

Easy

You are integrating with a SOAP service. Which format must you use?

HTML · starter
format =
Check your understanding before moving on.
Knowledge checkQuestion 1

Which format natively supports namespaces and mixed content?

Select an answer to continue
Study tools

Make it yours.

Keep a private note for this lesson, then turn the key ideas into flashcards you can revisit.

Sign in to save notes and flashcards.Both are private to your account and stay with your progress.
Sign in
Finished reading?

Lock in what you just learned.

Mark this lesson complete to save your place and move one step closer to the certificate.

Lesson 10 of 300 · 0% of course