ropotan
11-30-2009, 11:13 AM
Hello, i'm pretty new to XML development, and i need some help with a pretty basic task.
I have this simple XML file, which has a basic structure like:
<players>
<name="John" x="10" y="10"></name>
</players>
and i'm trying to build a sort of PHP parser which receives an x and y value for a specific name and changes the attributes of that specific name. i googled and found some options like replacing the whole node, with remove and add in SimpleXML or DOM. i was just wondering if there is another more elegant way to change the x and y attribute or is this the best way to do it?
Thank you!
I have this simple XML file, which has a basic structure like:
<players>
<name="John" x="10" y="10"></name>
</players>
and i'm trying to build a sort of PHP parser which receives an x and y value for a specific name and changes the attributes of that specific name. i googled and found some options like replacing the whole node, with remove and add in SimpleXML or DOM. i was just wondering if there is another more elegant way to change the x and y attribute or is this the best way to do it?
Thank you!