Showing posts with label XML. Show all posts
Showing posts with label XML. Show all posts

Tuesday, November 27, 2012

XML: For my Ninth Grader - Part 2

XML: For my Ninth Grader - Part1



But any real book has a name, author name, text under each element, chapter name, and section name. This information is still not represented anywhere. Let us try to represent this information.

  


If you notice in pictogram, few of the additional information added can be represented better if that gets its own box. For example, in Book --> Front Matter --> Forward, Content need to be broken into Paragraphs and each Paragraph should have its own box.

Lets’ redraw the book picture again with additional understanding.
 






If you notice, few of the things from boxes of previous picture are moved into new boxes while some are remaining inside the original box. For example in forward box, heading remains inside the box while paragraph has moved out.  

This decision is arbitrary and left to the designer of the XML. I have chosen to follow a simple rule. Something which is small will remain the box and something which is big enough, should move out and acquire its own box.

Now let us assume a book which is very simple (so it does not have most the optional elements). So my book’s structure is:


Now let us represent this picture in the form of the text.
 


 


This textual representation is XML.

Reference:

Monday, November 26, 2012

XML: For my Ninth Grader - Part 1



For the time being forget about XML. Think about a book, to be specific about your favorite novel. Mine favorite is A Brief History of Time by Stephen Hawking

I will stick to my favorite but you can think of your favorite.

Most of the books can be structured into three broad parts.

  1. 1 Front Matter
  2. 2Body Matter
  3. 3Back Matter

Front Matter as name suggests, is the first part of a book, and is usually the smallest section in terms of the number of pages.  It consists of following elements:



Name
Required
Purpose
Title page
Yes
Repeats the title and author as printed on the cover or spine.
Colophon
Yes
Information such as edition dates, copyrights, the name and address of the printer. In some books this is placed at the end (refer Back Matter).
Contents
Yes
This is a list of chapter headings, and nested subheadings. This includes all front-matter items listed below together with chapters in the body matter and back matter.
Foreword
Yes
A foreword tells of some interaction between the writer of the foreword and the author.
Preface
Yes
A preface covers the story of how the book came into being, or how the idea for the book was developed; this is often followed by thanks and acknowledgments to people who were helpful to the author during the time of writing.
Acknowledgment
Yes
Part of the Preface, rather than a separate section in its own right, it acknowledges those who contributed to the creation of the book.
Introduction
Yes
It states the purpose and goals of the following writing.
Dedication
Yes
A dedication page is a page in a book that precedes the text, in which the author names the person or people for whom he/she has written the book.
Prologue
No
A prologue is an opening to a story that establishes the setting and gives background details, often some earlier story that ties into the main one, and other miscellaneous information.
  



Body Matter consists of most of the bulk of any book.  In a simple book only two elements exists in this part.

Chapters and sections. Each chapter is divided into one or more sections.

Back Matter is also divided into multiple elements.



Name
Required
Purpose
Epilogue
No
This piece of writing at the end of a work of literature or drama is usually used to bring closure to the work.
Afterword
No
An afterword generally covers the story of how the book came into being, or of how the idea for the book was developed.
Conclusion
Yes

Postscript
No

Appendix or Addendum
No
This supplemental addition to a given main work may correct errors, explain inconsistencies or otherwise detail or update the information found in the main work.
Glossary
No
The glossary consists of a set of definitions of words of importance to the work. They are normally alphabetized. The entries may consist of places and characters, which is common for longer works of fiction.
Bibliography
No
This cites other works consulted when writing the body.
Index
No
This list of terms used in the text contains references, often page numbers, to where the terms can be found in the text.
Colophon
No
This brief description may be located at the end of a book. It describes production notes relevant to the edition.
 


Now this information can be graphically depicted as: