nerdexam
Cisco

200-901 · Question #520

How do JSON and XML compare?

The correct answer is C. The syntax of XML contains tags, elements, and attributes whereas JSON objects are collections. XML (eXtensible Markup Language) uses a tag-based syntax where data is wrapped in opening and closing tags (e.g., <name>value</name>), organized into elements, and can include attributes within tags (e.g., <user id='1'>). JSON (JavaScript Object Notation) represents data as colle

Understanding and Using APIs

Question

How do JSON and XML compare?

Options

  • AThe syntax of JSON contains tags, elements, and attributes whereas XML objects are collections
  • BJSON objects are an ordered set of element attributes whereas XML arrays are an unordered set
  • CThe syntax of XML contains tags, elements, and attributes whereas JSON objects are collections
  • DJSON arrays are an unordered set of key-value pairs whereas XML objects are an ordered set of

How the community answered

(66 responses)
  • A
    2% (1)
  • B
    6% (4)
  • C
    88% (58)
  • D
    5% (3)

Explanation

XML (eXtensible Markup Language) uses a tag-based syntax where data is wrapped in opening and closing tags (e.g., <name>value</name>), organized into elements, and can include attributes within tags (e.g., <user id='1'>). JSON (JavaScript Object Notation) represents data as collections: objects are unordered sets of key-value pairs enclosed in curly braces {}, and arrays are ordered lists enclosed in square brackets []. Choice A incorrectly reverses the descriptions, attributing tags/elements/attributes to JSON. Choice B incorrectly states JSON objects are ordered (they are unordered) and confuses XML arrays (XML has no native array type). Choice D incorrectly describes JSON arrays as unordered key-value pairs (arrays are ordered lists, not key-value pairs).

Topics

#JSON syntax#XML syntax#Data serialization formats#API data formats

Community Discussion

No community discussion yet for this question.

Full 200-901 Practice