On Fri, Apr 15, 2011 at 5:17 PM, P T Withington <[email protected]> wrote:

> Have a look here:  http://bit.ly/dFVIe7 which says:
>
> > When a view's datapath matches more than one data node, one instance of
> the view is created for each match.
>

yes, the issue with that section is that it shows how to set the content of
a child element in the view via the datapath (e.g.  <text
datapath="firstName/text()"/>) but it doesnt show how to set an attribute in
the constructor call, such as I have tried here:

  <asanaview name="av" datapath="dset:asanas/asana" asana="name/text()"
imgurl="img_url/text()" />

Complete source code follows:

<canvas>

<dataset name="dset" request="true" type="http" src="
http://static.livingcosmos.org/tmp/asanas.xml"/>

<class name="asanaview" bgcolor="blue" width="300" height="200">

<attribute name="asana" type="string" />
<attribute name="imgurl" type="string"/>


<simplelayout axis="y" spacing="4"/>

<text bgcolor="green" text="${classroot.asana}" />
<view width="${parent.width}" stretches="both"
resource="${classroot.imgurl}"/>

</class>

<window>

<asanaview name="av" datapath="dset:asanas/asana" asana="name/text()"
imgurl="img_url/text()" />
<scrollbar/>
</window>

</canvas>

Reply via email to