PDA

View Full Version : Does getXPath method support query by attribute value?


Peter_Chea
06-25-2003, 02:20 PM
Does getXPath method support query by attribute value?

var p = canvas.datasets.returnflights.getPointer().getXPat h("flights/returnflights[@name='AmericaWest']");

antun
06-25-2003, 02:47 PM
I don't believe that's possible - is it in the XPath spec at all?

A rough suggestion for what you're trying to do is to have some logic executed ondata that shows or hides the view based on the value of the name attribute. Doesn't sound very good.

I'll see if there is another way around this.

-Antun

Peter_Chea
06-25-2003, 03:52 PM
Antun, don't worry about. I got it fixed.I was trying to present different set of data on the same view depend of the user input.
<view name="returnsearchresult" width="immediatpaent.width" height="immedateparent.height" >
<method name="changeAirline" args="airline">
var dp = this.getReturnFlight(airline);
this.grid.datapath.setFromPointer(dp);
</method>
<method name="getReturnFlight" args="airlineName">
<![CDATA[
var p = canvas.datasets.returnflights.getPointer().getXPat h("flights");
p.selectChild( 1 );
do {
if(p.getNodeAttribute("name") == airlineName )
{
return p;
debug.write(p.getNodeAttribute("name"));
}
} while (p.selectNext() );

]]>
</method>
<flightsearchresultgrid name="grid"/>
</view>