ch_bowen
04-08-2004, 11:55 AM
I have a question regarding the use of LzDatapointer.xpathQuery() vs LzDataPointer.getXPath(). It seems when using the xpathQuery() method, then calling setNodeAttribute(), in the debug window I get the following message:
"call to undefined method 'setNodeAttribute'"
However, when using dp.getXPath() then set the node attribute, it works fine. How do I modify a node attribute if I want to avoid using dp.getXPath().
//doesn't work!
var test1 = dp.xpathQuery('parent/child[1]');
test1.setNodeAttribute('value', 'aValue');
//works fine!
var test2 = dp.getXPath('parent');
var child = test2.getXPath('child[1]');
child.setNodeAttribute('value', 'aValue');
Thank you,
Chris
"call to undefined method 'setNodeAttribute'"
However, when using dp.getXPath() then set the node attribute, it works fine. How do I modify a node attribute if I want to avoid using dp.getXPath().
//doesn't work!
var test1 = dp.xpathQuery('parent/child[1]');
test1.setNodeAttribute('value', 'aValue');
//works fine!
var test2 = dp.getXPath('parent');
var child = test2.getXPath('child[1]');
child.setNodeAttribute('value', 'aValue');
Thank you,
Chris