nerdexam
Cisco

200-901 · Question #10

Refer to the exhibit. Which JSON is equivalent to the XML-encoded data? A. B. C. D.

The correct answer is C. { "books": { "science": { "biology": "10.00", "geology": "9.00", "chemistry": "8.00" }, "math": { "calculus": "20.00", "algebra": "12.00" } } }. Converting XML-encoded hierarchical data to its JSON equivalent requires correctly mapping nested XML elements to nested JSON objects with matching key-value pairs.

Understanding and Using APIs

Question

Refer to the exhibit. Which JSON is equivalent to the XML-encoded data? A. B. C. D.

Exhibits

200-901 question #10 exhibit 1
200-901 question #10 exhibit 2
200-901 question #10 exhibit 3
200-901 question #10 exhibit 4

Options

  • A{ "books": { "science": { "biology": "10.00", "geology": "9.00", "chemistry": "8.00" }, "math": { "calculus": "20.00", "algebra": "12.00" } } }
  • B{ "books": { "science": { "biology": "10.00", "geology": "9.00", "chemistry": "8.00" }, "math": { "calculus": "20.00", "algebra": "12.00" } } }
  • C{ "books": { "science": { "biology": "10.00", "geology": "9.00", "chemistry": "8.00" }, "math": { "calculus": "20.00", "algebra": "12.00" } } }
  • D{ "books": { "science": { "biology": "10.00", "geology": "9.00", "chemistry": "8.00" }, "math": { "calculus": "20.00", "algebra": "12.00" } } }

How the community answered

(66 responses)
  • A
    2% (1)
  • B
    2% (1)
  • C
    94% (62)
  • D
    3% (2)

Why each option

Converting XML-encoded hierarchical data to its JSON equivalent requires correctly mapping nested XML elements to nested JSON objects with matching key-value pairs.

A{ "books": { "science": { "biology": "10.00", "geology": "9.00", "chemistry": "8.00" }, "math": { "calculus": "20.00", "algebra": "12.00" } } }

Choice A incorrectly structures or orders the JSON object such that it does not faithfully replicate the hierarchy or values present in the source XML.

B{ "books": { "science": { "biology": "10.00", "geology": "9.00", "chemistry": "8.00" }, "math": { "calculus": "20.00", "algebra": "12.00" } } }

Choice B contains a structural or value mismatch that does not accurately reflect the nesting and data from the original XML-encoded document.

C{ "books": { "science": { "biology": "10.00", "geology": "9.00", "chemistry": "8.00" }, "math": { "calculus": "20.00", "algebra": "12.00" } } }Correct

Choice C correctly represents the hierarchical XML structure as a nested JSON object, with 'books' as the root key containing 'science' and 'math' sub-objects, each holding the appropriate leaf key-value pairs with their numeric string values. Proper JSON encoding preserves the parent-child relationships expressed in the original XML elements.

D{ "books": { "science": { "biology": "10.00", "geology": "9.00", "chemistry": "8.00" }, "math": { "calculus": "20.00", "algebra": "12.00" } } }

Choice D misrepresents the XML data by using an incorrect structure or incorrect key-value assignments that diverge from the source XML.

Concept tested: XML to JSON data format conversion

Source: https://developer.cisco.com/docs/platform-introduction/

Topics

#XML#JSON#Data Conversion#API Data Formats

Community Discussion

No community discussion yet for this question.

Full 200-901 Practice