PDA

View Full Version : Search for simple way to set a text nod


vernid
10-28-2007, 01:27 PM
Hi,

Is there a simplest way to do this?

var node = classroot.datapath.xpathQuery('patient/id');
node.replaceChild(new LzDataText(sel.datapath.xpathQuery('id/text()')),node.childNodes[0]);


Thanks
Dominique

caducarbonari
10-29-2007, 05:53 AM
I think that is...
Another way is you create another datapointer and use setNodeText():

var dp = classroot.datapath.dupePointer();
dp.setXPath('patient/id');
dp.setNodeText(sel.datapath.xpathQuery('id/text()'));

But you will instantiating another datapointer, couse this i think that your solution is better.

vernid
10-29-2007, 10:52 AM
Hi,

I prefer your solution because at the end of the day you don't create any LzDataText.

Thx
Dominique