Browse DevX
Sign up for e-mail newsletters from DevX


Mozilla's Potpourri of Rendered XML  : Page 4

Mozilla 1.0 is busting out and it can display a lot more than just text, links, and images. Check out the interaction of display standards at work in this new browser.




Building the Right Environment to Support AI, Machine Learning and Deep Learning

Breaking Out of the Text Box
So you can put different kinds of content in a single document, plus foreign objects such as images, and have it all render to the screen. Finally there's a browser that fulfills the original purpose of the Web—to publish engineering information about CERN's particle accelerator in Switzerland! SVG and MathML let technical people document their diagrams and mathematics. What about the rest of the Web audience? Well, your creative boundaries just expanded greatly. Here's an example.

Anyone who's read Alice in Wonderland (Lewis Carroll) or The Demolished Man (Alfred Bester) knows that text documents needn't be a boring train of fully justified paragraphs. Text can go down the rabbit hole, criss-cross itself or fly away completely. Word games are a prime example. Here's a trivial HTML-only word puzzle:


The solution to this puzzle is "sandbox"—an everyday term. This example is a typical abuse of HTML—the box is a one—cell table. Table borders aren't supposed to be used as boxes; they're supposed to be table borders. SVG is a much better choice for drawing a box. Example 3 has four similar puzzles that exploit Mozilla capabilities (remember that since IE is incapable of displaying the examples, Example 3 will show either an error or XML source code when viewed in IE). The solutions are at the bottom. If you examine the source code, you'll see that the tags beginning with <html:, <mathml:, and <svg: are deeply combined together, although they are still nested correctly as XML demands.

Figure 3: These puzzles use only simple images—the code uses MathML to display the the mathematical formulas and SVG for some of the graphic content.
For content such as these puzzles, you may need to reload regularly and often—Mozilla's not quite bug free yet. Do the SVG images remind you of a Macromedia Flash image? They should—SVG is an emerging Flash competitor. Also note the DOCTYPE has changed slightly so that you can reference entities such as &Integral directly. Unfortunately, there are no power tools yet that make multi-standard composition easy. Until they arrive, you'll have to hack through the standards. By being able to render content from several different DTDs, Mozilla raises the bar on XML display in Web browsers, although standards coverage such as MathML and SVG still has some cracks and gaps. Even at this early stage though, Mozilla promises to be a definite win for specialised users such as those in universities and schools by letting developers compose richer documents.

Nigel McFarlane is a software engineer and technical writer. He spends most of his time in the Telecommunications and MIS problem domains. Reach him by e-mail at nrm@kingtide.com.au.
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date