Yeah I realized after I sent the email that I hit reply instead of reply all. What can you do. Glad to hear you got it working
Chris On 11-04-16 02:33 AM, Terrence Brannon wrote: > > > On Fri, Apr 15, 2011 at 11:27 PM, Chris Janik <[email protected] > <mailto:[email protected]>> wrote: > > I think you have to use path like this > > <asanaview name="av" datapath="dset:asanas/asana" > asana="$path{'name/text()}" imgurl="$path{'img_url/text()'}" /> > > > Yes, that worked, but only the last element in the dataset rendered. I > think it's because there is not a unique name for each view and so > they overwrote each other. I tried setting an attribute > name="${'uniqueid' + this.pos()}" but that failed with an error > > Are you aware you sent me direct mail instead of mail to the list? > Entire source code follows for reference: > > <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 datapath="dset:/asanas/asana/" asana="$path{'name/text()'}" > imgurl="$path{'img_url/text()'}" /> > <scrollbar/> > > </window> > > </canvas> > > > > > > I can't remember if you need the quotes around the datapath or > not. If this doesn't work let me know and I'll send you the code > I've been using to do a very similar thing that should help you. > > Chris > > On Fri, Apr 15, 2011 at 7:02 PM, Terrence Brannon > <[email protected] <mailto:[email protected]>> wrote: > > > > On Fri, Apr 15, 2011 at 5:17 PM, P T Withington <[email protected] > <mailto:[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> > > >
