JavaScript vs XML Flashcards
What can data objects be formatted as?
- XML
- JSON
What is XML?
XML (extensible markup language) is a markup language based on tags, similar to HTML; it is used to transport data around a network and also for data storage.
What is JSON?
JSON (JavaScript object notation) is a text-based, human-readable data format that is used to transmit data around a network.
Which is better in term of human readability?
Human readability – easier to read in JSON as it is written as a list of objects and their values, whereas XML data is more cluttered as it is contained within markup tags
Which is better in term of parsing?
Parsing – faster to parse in JSON as it is clearly defined as a list objects and their values, whereas in XML each object and its value have to be removed from their tags
Which is better in term of code creation?
Code creation – JSON creates less code for a given data set than XML, and the coding is easier to create as the JSON syntax is simpler than
Which is better in term of data types?
Data types – XML can be used to create any data type required where this data structured into an easy-to-read format, whereas JSON may have too limited a range of data for all applications