0
我該如何使用類似jQuery & PHP來對xml文件中的元素重新排序?用jQuery重新排序XML元素,然後用php保存XML文件
下面的jQuery插件允許交換html錶行或列表項,但我不知道如何通過單擊按鈕將這些更改保存回XML文件。
www.isocra.com/2008/02/table-drag-and-drop-jquery-plugin/
www.jqueryui.com/demos/sortable/
這描述了一個功能重新排列/重新排序元素: http://quest4knowledge.wordpress.com/2010/09/04/php-xml-create-add-edit-modify-using-dom-simplexml-xpath/
但是,這隻顯示如何交換兩個元素的位置,而不是多個。 它們是否可以合併以重新排列更長的元素列表?
我試圖避免使用MySQL,PHP只/ jQuery的/ XML ...
<?xml version="1.0" encoding="utf-8"?>
<gallery>
<picture id="0001">
<title>Title One</title>
<description>Some text here</description>
</picture>
<picture id="0002">
<title>Title Two</title>
<description>Some more text here</description>
</picture>
<picture id="0003">
<title>Title Three</title>
<description>Some other text here</description>
</picture>
</gallery>
感謝安迪。使用
: