V
V
vitkuz5732021-12-11 19:15:33
PHP
vitkuz573, 2021-12-11 19:15:33

How to dynamically (???) change an XML document?

There is something like this XML content:

<test name="test_1" id="random_id">
    <description>description</description>
    <test_element>
        <nodes>
            <node id="0" left="10" top="5" icon="test.png" param1="x" param2="y"/>
            <node id="1" left="20" top="10" icon="test1.png" param1="z" param2="r"/>
        </nodes>
    </test_element>
</test>


It is rendered using php on the page, the icon is displayed from the icon parameter, the object is positioned according to the coordinates from the left and top parameters.

All objects can also be moved around the page. This is where the task of remembering the new position of the object appears, i.e. its left and top coordinates if it was moved and immediately change these values ​​for this element in XML (after the element was "released" by the cursor) so that after refreshing the page it does not end up in the same place.

How can this be implemented and how to do it right?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Aricus, 2021-12-14
@vitkuz573

It is better to extract data in js at the right moments, and send it via ajax, where it is already in php to form and overwrite xml.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question