Skip to content

XML Issues

November 8, 2009
by

Getting a lot of panicked emails about XML and the rather cryptic message Firefox gives when trying to view an XML file’s contents: 

“This XML file does not appear to have any style information associated with it. The document tree is shown below.”

First, at no place in the assignment does the requirements ask you to view the file in a browser, or present a screenshot of what it should look like…that students are trying to do this is understandable as that is what we all have been used to doing: coding then viewing the results in a browser.

We all love unwrapping the present when viewing our work, “ooh, what did I get?!”

But not with XML. The Firefox message is telling you XML isn’t meant to be viewed, it is meant to carry messages/content.

Perhaps a metaphor is in order!

Standard mail is sent in an envelope which is a container of a message usually written on paper in a language of some sort. If the proper information is found on the outside of the envelope (sender address, recipient address, postage) the message will arrive at its destination with the carrier having no idea of the contents.

In the scheme of the Internet, Firefox is the postal worker carrying the mail. The roads, postal trucks, sorting machines and the rest are the network hardware. Firefox cannot “do” anything with an XML file unless an XSL file (eXtensible Style Language) is part of the works and explicitly tells the browser how to handle each of the elements and the contents of the elements.

If the XML file has an RSS declaration, Firefox will ask you, “what to do with it, sir!”  Save with LiveBookmarks? Some other application? If the format isn’t obvious Firefox just shows the code and tells you it doesn’t know what to do with the contents of the file but, “here they are anyway as I am a good piece of software.”

The programming language of XSL is XSLT (XSL Transformations) and is NOT user friendly or easy to understand, so none of you have to use it. In fact JSON and JQUERY were invented to replace it (and XML) because they are so hard to deal with.

All the student has to do is make the envelope and put some mail in it (XML file that contains the 10 items from the table). No style, no transformations, just write a DTD which creates the rules you made up that makes the envelope work.

Advertisements
One Comment leave one →
  1. AnahitP permalink
    November 9, 2009 8:36 pm

    Thanks for this clarification.

Leave a Reply

Please log in using one of these methods to post your comment:

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

%d bloggers like this: