k-billy
04-23-2004, 05:15 PM
I am sending in different datapointers to the same method. I call the serialize method on the datapointers, and get different result.
The code in the method is the following, where rootParent is the pointer passed to the method:
var root = rootParent.dupePointer();
root.setXPath("root");
Debug.Write("rootParent: " + rootParent.serialize());
Debug.Write("root: " + root.serialize());
Debug.Write("rootParent: " + rootParent.toString());
Debug.Write("root: " + root.toString());
var what = root.xpathQuery("el/hints/_what/sv/text()");
So, the first time the method is called, the output is:
´string#0| rootParent: <dsEditManagerBuffer><root ref="root/el" id="root">....
´string#1| root: <root ref="root/el" id="root">....
rootParent: Datapointer named null
root: Datapointer named null
The second time the method is called, the ouput is:
rootParent: <UtilLibrary_SaveDataset><root ref="root/el" id="root">....
root: <root ref="root/el" id="root">....
rootParent: Datapointer named null
root: Datapointer named null
This seems to be some 'really' strange behaviour. Where is 'string#0' pattern coming from in the first example? Is this a type problem? In the first example, our xpath query for the 'what' paramater works. It doesn't in the second. We are using Laszlo version 2.1.1. and the canvas is set to version 1.1.
The code in the method is the following, where rootParent is the pointer passed to the method:
var root = rootParent.dupePointer();
root.setXPath("root");
Debug.Write("rootParent: " + rootParent.serialize());
Debug.Write("root: " + root.serialize());
Debug.Write("rootParent: " + rootParent.toString());
Debug.Write("root: " + root.toString());
var what = root.xpathQuery("el/hints/_what/sv/text()");
So, the first time the method is called, the output is:
´string#0| rootParent: <dsEditManagerBuffer><root ref="root/el" id="root">....
´string#1| root: <root ref="root/el" id="root">....
rootParent: Datapointer named null
root: Datapointer named null
The second time the method is called, the ouput is:
rootParent: <UtilLibrary_SaveDataset><root ref="root/el" id="root">....
root: <root ref="root/el" id="root">....
rootParent: Datapointer named null
root: Datapointer named null
This seems to be some 'really' strange behaviour. Where is 'string#0' pattern coming from in the first example? Is this a type problem? In the first example, our xpath query for the 'what' paramater works. It doesn't in the second. We are using Laszlo version 2.1.1. and the canvas is set to version 1.1.