Tags are used for complex data, but attributes are used for simple data. Attributes are key/value pairs where the values are contained in quotation marks. They are typically "metadata," which is data about data. Peter concludes by showing examples of XML files that are analogous to the JSON examples.
- [Voiceover] In addition to content,…tags can have attributes as a way to hold simple data.…This data takes the form of a string.…Attributes are key value pairs, much like what you have…in JSON, where both the key and value are strings.…Although both values are strings,…the keys do not have quotes around them.…And the rules for attribute keys follow the…same rules as those for tags.…Only letters, numbers, and underscores,…and they must start with a letter.…The values do have quotes around them.…Attributes are placed inside of the start tag.…
There are many ways to design XML files,…and the most common design is…not to use attributes for data.…Instead they are used to indicate some property…about the data that's in the content of the tag.…Another way to phrase this is to say…that they are used for metadata.…One reason for doing it this way is that the…APIs often provide the option of using either JSON or XML.…By using attributes sparingly, it makes it easier to have a…simple mapping between the equivalent JSON and XML files.…
- The purpose of documentation
- Data types
- Structured data
- Writing JSON and XML
- Documenting one-level JSON responses
- Documenting nested JSON responses
- XML attributes and examples
- Documenting XML
- Structuring data documentation
Skill Level Intermediate
Project Management: Iterative Methodswith Bob McGannon1h 16m Intermediate
Technical Writing: Reportswith Judy Steiner-Williams2h 30m Intermediate
Introduction to JSON and XML Documentation
Next steps1m 10s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.