Unit 7: Learning XML

My Background
I had some brief exposure to XML when I worked as a technical writer as technical writers are very interested in producing a document once and then converting it for use in another language or another company. I did not work with XML but investigated its use in technical writing. For more on XML and technical writing see http://www.writingassist.com/resources/articles/xml-authoring-coming-to-a-desktop-near-you/ However, I did not start with the basics of XML and quickly got confused with the concept of XML schemas and DTDs or document type definitions.

XML Basics
Convinced that I needed to start with the basics as I had not even created an XML document, I started with Virtual Training Company’s Introduction to XML by Mark Long. See http://www.vtc.com/products/Introduction-To-XML-tutorials.htm I paid particular attention to the material on syntax having learned from programming that syntax was a vital component of any language. If I had a good understanding of syntax then I would avoid much frustration from such items as parsing errors later on. I supplemented the material on syntax from Long’s course with the material from W3Schools. See http://www.w3schools.com/xml/xml_syntax.asp I finished viewing the section on XML Documents in Long’s course while supplementing it with the W3Schools course on XML.

XML: Beyond the Basics
Next, I viewed the video Just Enough XML to Survive (10 minutes) at http://youtube.com/watch?v=clJcs2-UB40. This video explained went beyond the basics and explained namespaces very well. I previously thought that XML with prefixes for the namespace was not an XML document as documents with namespaces look different than basic XML documents.  An interesting feature of this video is the visual tags which point to certain features of the code. The visual tags are very helpful. The video, however, would have been better if the pace was similar to the pace in Long’s video segments. I could not, for instance, get a complete grasp of XML schemas from this video. Again, I supplemented the material on schemas by using the W3Schools material.

The Just Enough XML to Survive did not explain why the words Encoding utf are written at the top of some XML documents. However, http://www.zvon.org/comp/r/tut-XML.html#Pages~XML_Declaration tutorial explained that if these words are not included then the XML 1.0 version is assumed. I need to learn more about utf and encoding.

Mozilla Firefox and XML
Although, Long recommends Internet Explorer for viewing XML documents Mozilla Firefox 21 identifies errors on the actual code line. I saw  a line number  in Firefox, line number 9, and then found the line number in HTML kit and was able to fix it rather than looking for a “needle in a haystack” which is an impossible task. This is particularly useful whne extra white space has been inserted such as in the whitespace before the word height in an element or
< height> See XML features in Mozilla Firefox at http://www.ibm.com/developerworks/xml/library/x-ffox2/

Error Line Identified in Friefox

Error Line Identified in Friefox

Guidelines from Attributes Document.
The document  Principles of XML design: When to use elements versus attributes: Exploring the oldest question in XML design. from http://www.ibm.com/developerworks/library/x-eleatt/index.html was very helpful as I wrote my XML document. The first principle is,

“If the information in question could be itself marked up in elements put it in an elements.” However, Ogbuji recommended that if the information in question is part of the essential material that is being expressed or communicated in the XML, put it in an element.  I did this with the unit element as it is an essential piece of information and would be of primary interest to most users. It could have also been an attribute such as dimension=”pixels” The identifier attribute (id =”1”) is not an essential part of the information as it is not of primary interest to users. Under the principle of structured information recommended that the personal name should be an element as the structure of personal names like Claude Monet can vary quite a bit. Next, Ogbuji dealt with  the principle of readability, “If the information is most readily understood an digested by a machine, use attributes.” I decided to use an attribute for the identifier labeled as id’s 1,2, and 3.

Programmers, according to Ogbuji, “in the case of XML…Decide it’s OK to just do what seems to work.” However, Ogbuji cautions against this approach as it has led to “”real and painful costs down the road.” I am not aware as yet of these “painful costs” but I am willing to lean from an experienced developer such as Ogbuji as I am more than aware of the problems that could be caused, for instance, by somebody who is inexperienced in using HTML or CSS style sheets. CSS stylesheets can cause major problems in web browsers if they are not designed properly.

Advertisements
This entry was posted in Uncategorized and tagged , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s