Stirbitch.com
Personal Page
Here
Simple Map Markup Language
As an exercise I devised an XML language called Simple Map
Markup Language, designed to define simple street maps.
Here is the DTD, and some sample
SMML, both presented as HTML so
they are accessible in any browser.
You might also find it interesting to try to view
the XML file directly in your browser.
I tried a three different approaches to rendering SMML,
and show the results below, all applied applied to the
same SMML sample.
My decision to use VML and an old Microsoft version of XSL
was constrained by what was available at the time when I did
this work (early 1999).
Java Applet
If you have the Java 2 plug-in for your browser (or don't mind
waiting while it installs itself, which should happen automatically)
you can run the the
Applet I wrote to render the XML.
It should work with most browsers, though problems have been observed
downloading the classes behind a firewall.
The Applet gives you Tooltip text as you move the mouse over the image.
And close to the red circle target area, you will find some items that
can be clicked on to get further information.
The source code is available.
Java 2 was used, mainly for the 2D Graphics API, though some
features of Swing also proved useful.
If you have problems with the Applet you could take a look at a GIF
screenshot of what the map should look like.
Vector Markup Language
In this approach, the SMML is converted to VML on the fly by JavaScript,
and the VML is rendered by MSIE.
Although I did not spend as much time on this as I did with the Java
approach, it is clear that the VML end result would be much less well
polished.
Roundabouts would be difficult to render well,
but text labels should not have been a problem.
As with the Java version, there is Tooltip-like text, but I have
implemented no other interactive features.
For non-MSIE users, here is a screenshot of what
the VML map looks like.
Extensible Stylesheet Language
Here I have used the old Microsoft version of XSL to transform SMML to
HTML, extracting and presenting textual information only.
You can see the results of this transformation,
done on the fly by MSIE if you have that browser.
If you view the source of this file, all you see is the XML,
this time including a reference to the stylesheet.
The stylesheet is itself XML; here it is presented in
an HTML page.
©1998-2002 S Slatcher