<Country id="USA" value="USA">
<cities>
<city link="">city1</subissue>
<city link="">city2</subissue>
</subissues>
</Country>
<Country id="UK" value="uk">
<cities>
<city link="">city3</subissue>
<city link="">city4</subissue>
</cities>
</Country>
I was wondering how I would be able to append, edit and delete information from the XML while it is on the server. I was thinking about using PHP for this. for example I want to add a new city under the USA or add a new country all together and add cities underneath that new country i just added. I was thinking about using a form to add the information. What would be the best approach to add cities to existing countries, add a new country with new cities option or delete a country or delete certain options. Is it possible that someone can also lay down how the form should be conceptually. thank you
The best way to do this would be to use a database (such as mysql or SQLITE) and generate the xml file upon request.
Then, in order to add a country or a city, all you would need to do would be a simple insert statement such as:
INSERT INTO locations VALUES('$country','$city');
And then have a php file with:
header("Content-Type:text/xml");
and then simply echo the xml data from the database.