View Full Version : XPath @Attributure not working
rayfusion
12-22-2005, 11:14 AM
The following code will not work
------
test.setAttribute('contentdatapath',"permit/fees[@id<'" + nn.getValue() + "']");
------
When I make it [id=2] instead of [id<2] it works fine. Any ideas why this is not working?
Thank.. Ray
seabascuit
12-23-2005, 05:11 AM
Originally posted by rayfusion
The following code will not work ------
When I make it [id=2] instead of [id<2] it works fine. Any ideas why this is not working?
is it can change contentdatapath dynamic?
i can't change it dynamic
i code like this
<grid name="test" datapath="mydataset:/*">
<gridtext datapath="@someattr">something</gridtext>
<gridtext datapath="@someattr1">some</gridtext>
</grid>
<button>
<method>
parent.test.setAttribute('contentdatapth', "myXml[@someattr = 'something']");
</method>
</button>
it doesn't work at all !```` who can help me
rayfusion
12-23-2005, 05:19 AM
Here is the code I am using and It is working correctly.
----
<button>Set datapath
<method event="onclick">
<![CDATA[
while (test.subviews[1].subviews[0].subviews.length>0)
{
test.subviews[1].subviews[0].subviews[0].destroy();
}
test.setAttribute('contentdatapath',"permit/fees[@id='" + nn.getValue() + "']");
test.init();
]]>
</method>
</button>
----
My issue is trying to grab all attributes that are [id<2]. Again.. [id= something] is the only query that is working.
userfriendly
12-23-2005, 06:37 AM
yip, tried those comparison operators too, and they don't work for me either. i guess it's a limitation of the xpath functionality laszlo supports.
rayfusion
12-23-2005, 06:43 AM
I agree...It seems that others are experiencing the same issue. Do Laszlo employees browse these forums? It would be really helpful for developers if they reply to these types of issues. That would save us DAYS on trying to figure out if our coding is bad or if there is a limitation of the software. Just thinking out loud.
seabascuit
12-24-2005, 08:53 PM
merry chistmas rayfusion and all the laszlo users
thank you for your help ~
I find the same way work well~
mallchin
07-10-2006, 08:52 PM
I had a similar problem and fixed it like so:
var srcXPathStart = "profileData:/DPS-PROFILES/PROFILE[@id = '";
var operatorID = "00001"
var srcXPathEnd = "']";
this.datapath.setXPath(srcXPathStart+operatorID+sr cXPathEnd);
Ugly, but it works. It's a shame you can't escape quotes (correct me if I'm wrong -- it didn't work for me).
Salicar
07-11-2006, 06:21 AM
comparison operators simply dont work.
lots of people requesting enhanced XPath support but no replies to the majority of them. it appears they are concentrating all there time on the legals releases.
vBulletin® v3.8.4, Copyright ©2000-2012, Jelsoft Enterprises Ltd.