Common files
Let's start by creating a structure that will be used to define the tags that are valid for our XML and JSON documents. These tags will be:
books
: This is the root element that encloses all the other elementsbook
: This element encloses all the information about a particular bookauthor
: This element contains the author's namepublisher
: This element contains the publisher's namecategory
: This element contains the category of the bookdescription
: This element contains the description of the bookname
: This is an attribute of the book element in the XML example and a standard element in the JSON example. This element contains the name of the book
The DocTags
structure will define the seven static properties that will contain the names of ...
Get Swift: Developing iOS Applications now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.