PDA

View Full Version : Displaying an RSS feed


lyndonwong
06-22-2003, 09:51 AM
Hi all --

Anyone have an LZX example of displaying RSS data?

Or advice on why the following feed (for example):

http://www.ventureblog.com/index.rdf

Isn't getting displayed by the following LZX code:

---------------
<!-- DEMO USING RSS XML DATASOURCE -->

<canvas height="600" width="800">

<dataset type="http" name="ventureblog" src="http://www.ventureblog.com/index.rdf" autorequest="true" />

<window width="300" height="200" resizable="true">
<simplelayout axis="y" />

<text> Blog data should appear below: </text>

<view name="BlogEntry" datapath="ventureblog:/rdf:RDF[1]/item[1]" >
<simplelayout axis="y" />
<text width="150" datapath="title/text()" />
</view>

</window>

</canvas>
---------

Thx for helping the 'newbie' :)

- lw

antun
06-22-2003, 04:55 PM
Hey lyndonwong

Here's the datapath I used for the BlogEntry view:


ventureblog:/RDF[1]/item[1]


I don't completely understand the XML features that are being used here (the colon between rdf and RDF for example, but here's how I debugged it:


<canvas height="600" width="800" debug="true">

<dataset type="http" name="ventureblog"
src="http://www.ventureblog.com/index.rdf" autorequest="true" />

<window width="300" height="200" resizable="true">
<simplelayout axis="y" />

<text> Blog data should appear below: </text>

<button>
<method event="onclick">
debug.write( this.parent.BlogEntry.datapath.serialize() );
</method>
</button>

<view name="BlogEntry" datapath="ventureblog:/">
<simplelayout axis="y" />
<text width="150" datapath="title/text()" />
</view>

</window>

</canvas>


I simplified the datapath, and added the method that wrote out the serialized datapath to the debugger. Then I read it off the debugger and used that XML structure as my guide.

-Antun

lyndonwong
06-22-2003, 07:22 PM
Hi Antun,

Thanks much for the assist (I've got a humble multi-app portal now! :-). And thanks for sharing the 'debugging' method.

inertia
02-03-2004, 08:44 PM
Originally posted by antun
I don't completely understand the XML features that are being used here (the colon between rdf and RDF for example, but here's how I debugged it:


It's called XML Namspaces. You can think of it as a type of interface construct in XML. In this example, an rdf element is expected to have an li element. So it is expressed as rdf:li. A dc element is expected to have a language element. So it is expressed as dc:language.

The spec:
http://www.w3.org/TR/REC-xml-names/