W3C home > Mailing lists > Public > xproc-dev@w3.org > February 2013

Could not load Map URIs

From: Liang LIU <mmhancxt@gmail.com>
Date: Sun, 3 Feb 2013 00:41:46 +0100
Message-Id: <2282B2F2-9698-45AC-99B1-A7345C09FC8B@gmail.com>
To: xproc-dev@w3.org
Dear all,
I meet a problem when I try to load map URI. Here's the code : 

<?xml version="1.0" encoding="utf-8"?>

<p:pipeline
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
    xmlns:p="http://www.w3.org/ns/xproc">
    
    <!-- We load the URI -->
    <p:load>
        <p:with-option name="href"
        select="'http://maps.googleapis.com/maps/api/staticmap?center=New+York,NY&amp;zoom=13&amp;size=600x300&amp;key=AIzaSyDILhsIDqGXMv5qDKyCO4uVA5aZuWjNbSs&amp;sensor=false'" />
    </p:load>

</p:pipeline>

And the error message: 

MacProOfLiang:XProc Xavier$ calabash new.xpl > test.html
Feb 3, 2013 12:26:17 AM com.xmlcalabash.util.DefaultXProcMessageListener error
SEVERE: err:XC0011:Could not load http://maps.googleapis.com/maps/api/staticmap?center=New+York,NY&zoom=13&size=600x300&key=AIzaSyDILhsIDqGXMv5qDKyCO4uVA5aZuWjNbSs&sensor=false (file:/Users/Xavier/Programs/XProc/new.xpl) dtd-validate=false
Feb 3, 2013 12:26:17 AM com.xmlcalabash.drivers.Main error
SEVERE: Unknown error

I've tried many URIs and also other methods to load the static map but all failed. Really thanks for your help.

Best regards,
L.L.


==================================================
PS: here the whole xlp file if needed.


<?xml version="1.0" encoding="utf-8"?>

<p:pipeline 
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
  xmlns:p="http://www.w3.org/ns/xproc">

  <!-- URL of the initial feed, assumed to be in RSS format -->
  <p:variable name="rss" select="'http://rss.cnn.com/rss/edition.rss'" />
    
  <p:variable name="yahoo-id" select="'HzdXzqDV34FDaZg12uNxNpkyMLsG2PjYP9PgQlKlTn86vEcsxXrKkt21VVpiiX4-'" />

  <!-- We load the RSS feed -->
  <p:load>
    <p:with-option name="href" select="concat('http://ws.geonames.org/rssToGeoRSS?feedUrl=',encode-for-uri($rss))" />
  </p:load>

  <!-- We collect all items -->
    <p:for-each name="items">
        <p:output port="result" sequence="true" primary="true" />
        
        <p:iteration-source select="//item[geo:lat and geo:long]" />
        
        <p:identity />
    </p:for-each>
    
  <p:for-each>
      <p:load>
          <p:with-option name="href"
          select="concat('http://local.yahooapis.com/MapsService/V1/mapImage?','appid=',$yahoo-id,'&amp;latitude=',*/geo:lat,'&amp;longitude=',*/geo:long,'&amp;radius=300&amp;image_height=200&amp;image_width=400')" />
          <!--
          <p:with-option name="href" select="'http://maps.googleapis.com/maps/api/staticmap?center=New+York,NY&amp;zoom=13&amp;size=600x300&amp;key=AIzaSyDILhsIDqGXMv5qDKyCO4uVA5aZuWjNbSs&amp;sensor=false'" />
           -->
          </p:load>
  </p:for-each>

  <!-- We wrap the sequence of 'item' nodes under a single 'items' node -->
  <p:wrap-sequence> 
    <p:with-option name="wrapper" select="'items'">
      <p:empty />
    </p:with-option>
  </p:wrap-sequence>

  <!-- We then use an inline stylesheet to format the sequence as an
       XHTML Web page -->
  <p:xslt>
    <p:input port="stylesheet">
      <p:inline>
        <xsl:stylesheet version="2.0"
          xmlns="http://www.w3.org/1999/xhtml">
          <xsl:output
            indent="yes"
            encoding="utf8"
            doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
            doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
          <xsl:template match="/">
            <html>
              <head>
                <title>Geolocalized news</title>
                <meta http-equiv="Content-Type" content="text/html;
                  charset=utf8" />
              </head>
              <body>
                <table>
                  <xsl:apply-templates select="items/*" />
                </table>
              </body>
            </html>
          </xsl:template>

          <xsl:template match="items/*">
            <tr>
                <td><xsl:value-of select="." /></td>
              <td><a href="{link}"><xsl:value-of select="title" /></a></td>
            </tr>
            <tr>
                <td><xsl:value-of select="geo:lat" /></td>
                <td><xsl:value-of select="geo:long" /></td>
            </tr>
          </xsl:template>
        </xsl:stylesheet>
      </p:inline>
    </p:input>
  </p:xslt>
</p:pipeline>
Received on Monday, 4 February 2013 20:29:03 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 4 February 2013 20:29:03 GMT