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:

No comments:

Post a Comment