Processing Forum
//xml1
proxml.XMLElement goalshoulder = new proxml.XMLElement("goal");
goalsshoulder.addChild(goalshoulder);
proxml.XMLElement positionshoulder = new proxml.XMLElement("position");
positionshoulder.addAttribute("xPos",shoulderSet);
positionshoulder.addAttribute("yPos",350);
goalshoulder.addChild(positionshoulder);
proxml.XMLElement positionTwoshoulder = new proxml.XMLElement("positionTwo");
positionTwoshoulder.addAttribute("xPosTwo", shoulderSet);
positionTwoshoulder.addAttribute("yPosTwo", 450);
goalshoulder.addChild(positionTwoshoulder);
xmlInOut.saveElement(goalsshoulder,"goalshoulder.xml");
//xml2
proxml.XMLElement goal = new proxml.XMLElement("goal");
goals.addChild(goal);
proxml.XMLElement position = new proxml.XMLElement("position");
position.addAttribute("xPos",torsoSet);
position.addAttribute("yPos",350);
goal.addChild(position);
proxml.XMLElement positionTwo = new proxml.XMLElement("positionTwo");
positionTwo.addAttribute("xPosTwo", torsoSet);
positionTwo.addAttribute("yPosTwo", 450);
goal.addChild(positionTwo);
xmlInOut.saveElement(goals,"goal.xml");
I end up with two xml-files. The first one has correctly stored the values, the second one (xml2) contains both the values of xml1 and xml2. I have the feeling that I should first check if the first file is finished saving before I start with the other one, but I don't know how to do this.
Any help is appreciated.
Luuk