On Mac OSX 10.7.3 with Firefox 10.0, I'm having trouble getting Google
charts when the web page is a result of an XSL transformation.
Strangly, the files operate correctly on Safari and Opera, but not on
Firefox or Google Chrome.

Here are two files X.xml and X.xsl.xml.  X.xml is a very simple file
consisting of a non-empty "X" tag and a reference to X.xsl.xml as its
XSL file for transformation.

X.xml:
<?xml version = "1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="X.xsl.xml"?>
<X>&#x00a0;</X>

X.xsl.xml is the XSL stylesheet.  It responds only to the tag <x> and
outputs the HTML of one of the Google charts examples.

X.xsl.xml:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"  xmlns:xsl="http://www.w3.org/1999/XSL/
Transform" >
<xsl:output method="html"/>
<xsl:template match="/X">
<html>
  <head>
    <script type="text/javascript" src="http://www.google.com/jsapi";></
script>
    <script type="text/javascript">
      google.load("visualization", "1", {packages:["corechart"]});
      google.setOnLoadCallback(drawChart);
      function drawChart() {
        var data = new google.visualization.DataTable();
        data.addColumn('string', 'Year');
        data.addColumn('number', 'Sales');
        data.addColumn('number', 'Expenses');
        data.addRows([
          ['2004', 1000, 400],
          ['2005', 1170, 460],
          ['2006',  860, 580],
          ['2007', 1030, 540]
        ]);

        var options = {
          width: 400, height: 240,
          title: 'Company Performance'
        };

        var chart = new
google.visualization.LineChart(document.getElementById('chart_div'));
        chart.draw(data, options);
      }
    </script>
  </head>
  <body>
    <div id="chart_div"></div>
  </body>
</html>
</xsl:template>
<!--
========================================================================--
>
</xsl:stylesheet>


Is there a problem in Javascript initialization?

Thanks,

Chris Kimball

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.

Reply via email to