Posted: Thu Jul 09, 2009 5:55 am Post subject: Altering environment using XPath and Java
Master
Joined: 26 Jun 2001 Posts: 248
Trying to set a value using Xpath in the Java Compute Node.
The structure of the tree is
t1
t2
t3
s
s1
where s and s1 repeat for every event.
The code is as follows:
MbElement position = msgAssembly.getGlobalEnvironment().getRootElement();
String ID = "/t1/t2/t3/?$s/?s1[set-value(9)]";
MbXPath xpth = new MbXpath(ID);
position.evaluateXPath(xpth);
This does not return an error of any sort or create anything on the environment tree. Changing ID to "/?t1/?t2/?t3/?$s/?s1[set-value(9)]" causes another branch to be created on the end, even though the environment tree already contains t1,t2 and t3. There are no namespaces in use.
Unforunately, the Java debugger will not shown the expanded tree which isn't very helpful. However, I can see the environment tree when the Java Compute node finshes. And the trace doesn't seem to give any explanation either. So, combined with the rather sketchy documentation in this area, I would be very grateful for any pointers!
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum