lyndonwong
06-21-2003, 06:02 PM
Hi Laszlo Team,
I need a little assistance! The following LZX script causes a compile error:
<image name="radarscan" width="173" height="130" stretches="both" datapath="@src"/>
In the otherwise working "Humble Weather App" source code below:
-------------------------------------
<!-- TEST OF LASZLO WEATHER DATA CGI DATASOURCE -->
<canvas>
<dataset type="http" name="weatherdata"
src="http://www.laszlosystems.com/cgi-pub/weather.cgi"/>
<window x="30" y="50" width="300" height="200">
<simplelayout axis="y" />
<text> Lyndon's Humble Weather App </text>
<view>
<simplelayout axis="x" />
<windowtext width="90" valign="bottom" name="t">zip</windowtext>
<button> submit
<method event="onclick">
var d = canvas.datasets.weatherdata;
d.setQueryString( { zip : parent.t.getText() } );
d.doRequest();
</method>
</button>
</view>
<view width="300" name="WeatherReport" datapath="weatherdata:/weather[1]/current">
<simplelayout axis="y" />
<text datapath="where/text()" />
<text datapath="station/text()" />
<text datapath="when/text()" />
<text datapath="desc/text()" />
<text datapath="temp/text()" />
</view>
<view name="RadarImage" datapath="weatherdata:/weather[1]/radar">
<text datapath="@src" />
<!-- FOLLOWING IMAGE TAG CAUSES COMPILE ERROR: 6-20-2003 LYNDON -->
<image name="radarscan" width="173" height="130" stretches="both" datapath="@src"/>
</view>
</window>
</canvas>
-------------------------------------
Can you help me understand what I'm doing wrong? I borrowed the above approach from weather.lzx source code.
Is there a simple alternative approach using the <resource> tag and extracting the URL from the Weather XML data?
Thx,
LW
I need a little assistance! The following LZX script causes a compile error:
<image name="radarscan" width="173" height="130" stretches="both" datapath="@src"/>
In the otherwise working "Humble Weather App" source code below:
-------------------------------------
<!-- TEST OF LASZLO WEATHER DATA CGI DATASOURCE -->
<canvas>
<dataset type="http" name="weatherdata"
src="http://www.laszlosystems.com/cgi-pub/weather.cgi"/>
<window x="30" y="50" width="300" height="200">
<simplelayout axis="y" />
<text> Lyndon's Humble Weather App </text>
<view>
<simplelayout axis="x" />
<windowtext width="90" valign="bottom" name="t">zip</windowtext>
<button> submit
<method event="onclick">
var d = canvas.datasets.weatherdata;
d.setQueryString( { zip : parent.t.getText() } );
d.doRequest();
</method>
</button>
</view>
<view width="300" name="WeatherReport" datapath="weatherdata:/weather[1]/current">
<simplelayout axis="y" />
<text datapath="where/text()" />
<text datapath="station/text()" />
<text datapath="when/text()" />
<text datapath="desc/text()" />
<text datapath="temp/text()" />
</view>
<view name="RadarImage" datapath="weatherdata:/weather[1]/radar">
<text datapath="@src" />
<!-- FOLLOWING IMAGE TAG CAUSES COMPILE ERROR: 6-20-2003 LYNDON -->
<image name="radarscan" width="173" height="130" stretches="both" datapath="@src"/>
</view>
</window>
</canvas>
-------------------------------------
Can you help me understand what I'm doing wrong? I borrowed the above approach from weather.lzx source code.
Is there a simple alternative approach using the <resource> tag and extracting the URL from the Weather XML data?
Thx,
LW