WebRef Update: Featured Article: X(ML) Marks the Spot | 2
X(ML) Marks the Spot
If you open a font tag and forget to close it in with </font>, your browser will have a fit and your document won't show. The basic rule therefore is that every tag must be opened and closed in a logical order. A logical order means that this works:
<b><i>bold&italic</i></b> and this doesn't: <b><i>bold&italic</b></i>. Just in case you're wondering, this won't work either: <b><i>bold&italic</I></B>. It's either uppercase or lowercase, there's no mixing involved in this game. Last but not least, <font color=white> won't work either, so don't forget your quotation marks. So this bug/feature will certainly haunt you for the first few XML documents you create (and probably all your documents when you are coding past your bedtime).The validity issue has another aspect: what about tags that aren't open or closed? The break tag <br> is a good example. This problem was solved with the syntax <br/>. Easy, isn't it? Another example to bring the point home: to place an image in the whatever.xls page use <img src="graphic.gif"/>.
Nowadays, many coders use an editor for tasks such as creating the code to place a Flash animation in a page. If you use Macromedia's Aftershock tool for Flash or Director, you'll have to adjust the code to be well-formed:
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="https://active.macromedia.com/flash2/cabs/swflash.cab#version=3,0,0,0" ID="projectxml" WIDTH="570" HEIGHT="100"> <PARAM NAME="movie" VALUE="flashanimation.swf"/> <PARAM NAME="quality" VALUE="autohigh"/> <PARAM NAME="bgcolor" VALUE="#FFFFFF"/>
<EMBED SRC="images/projectxml.swf" swLiveConnect="FALSE" WIDTH="570" HEIGHT="100" QUALITY="autohigh" BGCOLOR="#FFFFFF" TYPE="application/x-shockwave-flash" PLUGINSPAGE="https://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"> </EMBED> </OBJECT>
All commonly used HTML editors can create invalid XML code. At the time of this writing, XML editors have started appearing on the Net. When using programming languages such as Java (in the HTML code), JavaScript, and VBScript, there is also a chance that the XML may not be valid. Thankfully, the parser (which takes the XML code and creates a viewable document) often lets you know roughly where the bug is. The parser in Explorer 5, for example, tells you if tags don't match. With this XML basis it is possible to create a complete XML document which can be viewed and manipulated with Explorer 5.0.
So where is XML going?
In the future, it's likely that XML programming and all its related applications (such as SMIL) will be as important in Internet development as predicted. HTML will not vanish off the face of the Earth; it will probably remain an important part of development. XML will, however, be an eXtensive framework to create an unimaginable amount of subset applications, such as the Wireless Application Protocol Markup Language (WML) and many others. XML has opened many exciting doors for both programmers and interactive designers.
About the author:
Leroyson Figueira is a freelance Web integrator based in Amsterdam, the Netherlands. He is currently enjoying himself with Flash 4, XML and beta-WAP applications. He can be reached at: [email protected] or at www.redhotmedia.nl.
Previous: Three Pages of an XML Document
This article originally appeared in the December 2, 1999 edition of the WebReference Update Newsletter.
Comments are
welcome
Written by Leroyson Figueira and
Revised: May 16, 2000
URL: https://webreference.com/new/xmlintro2.html