Using proXML to write on XML file (e.g. <posx>5.0</posx)
in
Contributed Library Questions
•
2 years ago
Hello,
I'm using
proXML to read and write an XML file, e.g.:
- <things>
- <thing>
- <posx>5.0</posx>
- <posy>10.0</posy>
- </thing>
- </things>
During the execution of my code, I want to update both
posx and
posy, but how do I do it (without using attributes)?
I've tried doing it like:
- proxml.XMLElement x = new proxml.XMLElement("posx");
- proxml.XMLElement y = new proxml.XMLElement("posy");
- things.removeChild(0);
- thing.removeChild(1);
- thing.removeChild(0);
- thing.addChild(x, 0);
- thing.addChild(y, 1);
- things.addChild(thing, 0);
But how do I add the values to
posx and
posy? I read them using
getChild(0), but
addChild can only be used with an
element, and not with
floats or
strings.
1