200-901 · Question #187
How do XML and JSON compare regarding functionality?
The correct answer is D. JSON natively supports arrays and XML does not natively support arrays.. JSON natively supports arrays using square bracket [] notation, making it straightforward to represent ordered lists. XML has no native array construct - to represent a list, you must repeat sibling elements and rely on the consuming application to interpret them as a collection.
Question
How do XML and JSON compare regarding functionality?
Options
- AXML provides support for mapping data structures into host languages than JSON.
- BXML provides more human readability than JSON.
- CJSON provides support for data types than XML.
- DJSON natively supports arrays and XML does not natively support arrays.
How the community answered
(47 responses)- A2% (1)
- B2% (1)
- C6% (3)
- D89% (42)
Explanation
JSON natively supports arrays using square bracket [] notation, making it straightforward to represent ordered lists. XML has no native array construct - to represent a list, you must repeat sibling elements and rely on the consuming application to interpret them as a collection. The other options are inaccurate: JSON (not XML) is generally considered more human-readable for data (B); XML supports complex data structures but JSON has more direct type mappings for primitives (C is poorly worded and not the best answer); and XML does not provide more data-structure mapping support than JSON (A).
Topics
Community Discussion
No community discussion yet for this question.