We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › proXML: Error saving xml
Page Index Toggle Pages: 1
proXML: Error saving xml (Read 695 times)
proXML: Error saving xml
Dec 3rd, 2006, 5:05am
 
FIXED!

Sorry, I didn't noticed that saveTo() changed to saveElement() with the new version.
http://www.texone.org/proxml/xmlinout_method_saveelement.htm


Hi,

I'm trying to create/save a xml document using the proXML lib. Just move to my macbook pro and the code seems to be broken o_0.

Code:

void processMapToXML () {
 try {
   String s = "";
   for (int i = 0; i < mapBuffer.length; i++) {
     if (i != 0) {
       s += ",";
     }
     s += mapBuffer[i];
   }
   XMLInOut xmlEx = new XMLInOut (this);
   XMLElement root  = new XMLElement("root");
   XMLElement level = new XMLElement("level");
   root.addChild(level);
   XMLElement size  = new XMLElement("size");
   size.addAttribute("numx", MAP_WIDTH);
   size.addAttribute("numy", MAP_WIDTH);
   size.addAttribute("size", MAP_FACE_WIDTH);
   level.addChild(size);
   XMLElement player = new XMLElement("player");
   player.addAttribute("x", arrUser[0]);
   player.addAttribute("y", arrUser[1] - MAP_POSITION_Y);
   level.addChild(player);
   XMLElement finish = new XMLElement("finish");
   finish.addAttribute("x", arrGoal[0]);
   finish.addAttribute("y", arrGoal[1] - MAP_POSITION_Y);
   level.addChild(finish);
   XMLElement ships = new XMLElement("ships");
   for (int i = 0; i < cntShip; i++) {
     XMLElement ship = new XMLElement("ship");
     ship.addAttribute("x", arrShip[i][0]);
     ship.addAttribute("y", arrShip[i][1] - MAP_POSITION_Y);
     ships.addChild(ship);
   }
   level.addChild(ships);
   XMLElement tiles = new XMLElement("tiles");
   tiles.addAttribute("value", s);
   level.addChild(tiles);
   xmlEx.saveTo(root, "map.xml");
 }catch (InvalidDocumentException e) {
   println("[e:] failed creating xml");
 }
}


Because of this line xmlEx.saveTo(root, "map.xml"); processing don't likes me anymore:

/tmp/build29237.tmp/Temporary_6927_633.java:196:5:196:33: Semantic Error: No accessible method with signature "saveTo(proxml.XMLElement, java.lang.String)" was found in type "proxml.XMLInOut".

Ideas would be great.
Page Index Toggle Pages: 1