xsl-list
[Top] [All Lists]

Re: [xsl] Q: How can Firefox access google maps api in XSLT?

2012-10-27 19:00:23
Thanks Martin,

As far as I can tell the problem with Firefox is likely caused by an
attempt to use the DOM's document.write method to inject a script
element dynamically. That is done by the Google maps code you include it
seems.

it seems that you did hit the bull's eye.

...
I don't see an easy workaround, unless Google provides an API or a way
to use the maps code without relying on document.write.

And since its a Javascript API, they might not even care on XSLT.


I was able to prove that your explanation is correct by getting this
Firefox
error console message:

Warning: A call to document.write() from an asynchronously-loaded external
script was ignored.
Source File: http://stamm-wilbrandt.de/en/xsl-list/gmap/s.ff.html
Line: 0


For that I made use of the Javascript XSLTProcessor directly in HTML page:
http://stamm-wilbrandt.de/en/xsl-list/gmap/s.ff.html

That page loads stylesheet "s.xsl", XML document "s.xml" and then
transforms.


Mit besten Gruessen / Best wishes,

Hermann Stamm-Wilbrandt
Level 3 support for XML Compiler team and Fixpack team lead
WebSphere DataPower SOA Appliances
https://www.ibm.com/developerworks/mydeveloperworks/blogs/HermannSW/
https://twitter.com/#!/HermannSW/
----------------------------------------------------------------------
IBM Deutschland Research & Development GmbH
Vorsitzende des Aufsichtsrats: Martina Koederitz
Geschaeftsfuehrung: Dirk Wittkopp
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294


|------------>
| From:      |
|------------>
  
--------------------------------------------------------------------------------------------------------------------------------------------------|
  |Martin Honnen <Martin(_dot_)Honnen(_at_)gmx(_dot_)de>                        
                                                                                
      |
  
--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| To:        |
|------------>
  
--------------------------------------------------------------------------------------------------------------------------------------------------|
  |xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com,                            
                                                                                
      |
  
--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Date:      |
|------------>
  
--------------------------------------------------------------------------------------------------------------------------------------------------|
  |10/26/2012 11:14 AM                                                          
                                                                     |
  
--------------------------------------------------------------------------------------------------------------------------------------------------|
|------------>
| Subject:   |
|------------>
  
--------------------------------------------------------------------------------------------------------------------------------------------------|
  |Re: [xsl] Q: How can Firefox access google maps api in XSLT?                 
                                                                     |
  
--------------------------------------------------------------------------------------------------------------------------------------------------|





Hermann Stamm-Wilbrandt wrote:

OK, now I really simplified the sample to a minimum.
The XML does not work for Firefox with the same error message, while the
XHTML is fine:
http://www.stamm-wilbrandt.de/en/xsl-list/gmap/s.xml
http://www.stamm-wilbrandt.de/en/xsl-list/gmap/s.html

Given the simplicity and that s.xsl just copies the XHTML file s.html I
have no idea on
what to do to make Firefox work with Google Maps API (v3) in a
stylesheet:

As far as I can tell the problem with Firefox is likely caused by an
attempt to use the DOM's document.write method to inject a script
element dynamically. That is done by the Google maps code you include it
seems.
As Firefox's XSLT implementation directly renders the result tree of the
XSLT transformation is does not support document.write in the result
document (see
https://developer.mozilla.org/en-US/docs/XSL_Transformations_in_Mozilla_FAQ#What_about_document.write.3F
).

I don't see an easy workaround, unless Google provides an API or a way
to use the maps code without relying on document.write.

--

                 Martin Honnen --- MVP Data Platform Development
                 http://msmvps.com/blogs/martin_honnen/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>