<?xml version="1.0"?> 
<xsl:stylesheet 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
  version="1.0">

<xsl:template match="/page/title">
<html>
<head>
<script>
function gmap()
{
query = escape(document.forms.gmap.q.value);
url = 'http://www.w3.org/2000/06/webdata/xslt?xslfile=http%3A%2F%2Fweblog.infoworld.com%2Fudell%2Fgems%2Fgmapxsl.xml&amp;xmlfile=http%3A%2F%2Fmaps.google.com%2Fmaps%3Fq%3D' + escape(query) + '%26output%3Dxml&amp;transform=Submit';
location = url;
}
</script>
<style>
.title { font-weight: bold; margin-top: 8pt }
body { font-size: 10pt; font-family: arial }
</style>
</head>
<body>
<form name="gmap" action="javascript:gmap()">
<input size="50" name="q" value="{.}"/> 
<input type="submit" value="google map query"/>
</form>
<xsl:apply-templates select="info" />
</body></html>
</xsl:template>

<xsl:template match="info">
<div class="title">
<xsl:value-of select="title"/>
</div>
<xsl:for-each select="address/line">
<div><xsl:value-of select="."/></div>
</xsl:for-each>
<div><xsl:value-of select="phone"/></div>
<div><xsl:value-of select="distance"/></div>
</xsl:template>

<xsl:template match="text()">
</xsl:template>


</xsl:stylesheet>
