我正在尝试制作网站XML编辑器,我正在使用spry数据集和嵌套数据集来执行此操作。但是我有一个像这样的XML文件:
<Seating_Plan>
<Department id="A">
<DeptCode>001</DeptCode>
<DeptName>Test1</DeptName>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5<li>
</Department>
<Department id="B">
<DeptCode>002</DeptCode>
<DeptName>Test2</DeptName>
<li>6</li>
<li>7</li>
<li>8</li>
<li>9</li>
<li>10</li>
</Department>
</Seating_Plan>
我的HTML就像这样:
<script type="text/javascript">
var XML = new Spry.Data.XMLDataSet("../XML/XML.xml", "Seating_Plan/Person");
var XML_Dept = new Spry.Data.XMLDataSet("../XML/XML.xml", "Seating_Plan/Department");
var dslists = new Spry.Data.NestedXMLDataSet("../XML/XML.xml", "li");
</script>
<div spry:region="XML_Dept">
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr class="XML_Container_Header">
<th height="40">ID</th>
<th>DeptCode</th>
<th>DeptName</th>
<th>Description</th>
<th>lists</th>
</tr>
<tr spry:repeat="XML_Dept">
<td><input id="ID_Dept" name="ID_Dept" type="text" class="textfields" value="{@id}" size="3" maxlength="3"></td>
<td><input id="ID_Dept" name="ID_Dept" type="text" class="textfields" value="{DeptCode}" size="30" maxlength="30"></td>
<td><input id="ID_Dept" name="ID_Dept" type="text" class="textfields" value="{DeptName}" size="50" maxlength="50"></td>
<td><input id="ID_Dept" name="ID_Dept" type="text" class="textfields" value="{li}" size="50" maxlength="50"></td>
<td spry:region="XML_Dept"><ul spry:repeatchildren="dslists"><li><input id="ID_Dept" name="ID_Dept" type="text" class="textfields" value="{li}" size="50" maxlength="50"></li></ul></td>
</tr>
</table>
使用Department&#34; A&#34;的XML LI元素正确显示第一行,但表中的第二行或部门B已复制部门&#34; A&#34; XML Li Elements,如何让它显示部门B li元素删除重复...?
换句话说:
任何想法都将不胜感激!!
非常感谢!
答案 0 :(得分:0)
不再支持SPRYS,最好使用其他研究中的JQUERY或Javascript。同时使用PHP Forms发布值可以很好地满足我的需求。