Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 14th, 2007, 04:45 PM
Registered User
 
Join Date: Mar 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to tomharding
Default XSL, Javascript and Google maps..

Hey all,

I'm really scratching my head over this problem here. I'm trying to get an XSL transformation to display google maps. I've stripped down the very basics and used the Google Maps Hello World script, but in XSL formatting.

The problem? It works fine and dandy in IE, but not in Firefox.

I tried the same hello world script in HTML format and it worked fine in both browsers.

Heres my script:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns="http://www.w3.org/1999/xhtml">

<xsl:template match="/">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title>Google Maps JavaScript API Example</title>



<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAArwtl8H-0vkbKUJQSKii7aBSmvnqj_jvWX9jzbAfFZqVyU1JN7hRy418Mp VHZx_OGhzqNA5ya6la-ZQ"
language="text/javascript" />
<script language="text/javascript">

//<![CDATA[

function load() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
map.setCenter(new GLatLng(37.4419, -122.1419), 13);
}
}

//]]>
</script>
</head>
<body onload_="load()" onunload_="GUnload()">
hello
<div id="map" style="width:500px; height:300px;"></div>
<br />boo
</body>
</html>

</xsl:template>
</xsl:stylesheet>

I've tried removing the slashes surrounding the CDATA as advised on other forums, but that didn't make any difference.

The 'hello' and 'boo' are just there for no reason at all.

I'm really really stumped. Whats worse is that this is for a final year project which makes it 10x worse!!

Using the web developer toolbar, i outputted the generated source and the second <script> tags come back as normal text. The CDATA only appears as slashes, whereas in the HTML version it appears in its entirety.

Could anyone tell me what I'm doing drastically wrong, before my skull cracks from banging it on the desk?

Thanks in advance,
Tom

 
Old March 14th, 2007, 06:05 PM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

Did you try removing the "//<![CDATA[" all together, I dont think you need this.



 
Old March 14th, 2007, 06:10 PM
Registered User
 
Join Date: Mar 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to tomharding
Default

Hey, thanks for the quick reply :)

And removing it didn't make any difference. Looking at the outputted javascript, the second <script> tag only appears as text too, strangely enough.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Hacked Bills Google Maps Code ramone_johnny Classic ASP Basics 5 August 5th, 2008 10:11 PM
Bills Whiz Bang Google Maps ramone_johnny Classic ASP Basics 2 August 1st, 2008 07:23 PM
Google Maps JS in ASPX page error kingroon ASP.NET 2.0 Basics 0 December 7th, 2007 09:52 AM
INFO: Adding Google Maps (New ASP.Net Control) jimibt BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 4 September 12th, 2007 03:18 AM
How to use Javascript in XSL umeshayk XSLT 3 January 16th, 2004 11:33 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.