以文本方式查看主题 - 中文XML论坛 - 专业的XML技术讨论区 (http://bbs.xml.org.cn/index.asp) -- 『 XML 与 数据库 』 (http://bbs.xml.org.cn/list.asp?boardid=17) ---- 求根据已查到的数据list,生成多个xml文件的算法!请各位指教了[求助] (http://bbs.xml.org.cn/dispbbs.asp?boardid=17&rootid=&id=51017) |
-- 作者:fairylily -- 发布时间:8/6/2007 3:52:00 PM -- 求根据已查到的数据list,生成多个xml文件的算法!请各位指教了[求助] 问题描述:根据已查到的数据list,本可以递归生成树形xml(多层),如: <root> <item id="1" fatherid="" name="总部"> <item id="10" fatherid="1" name="分公司1"> <item id="100" fatherid="10" name="分公司1的子公司1" /> <item id="101" fatherid="10" name="分公司1的子公司2" /> <item id="102" fatherid="10" name="分公司1的子公司3" /> </item> <item id="11" fatherid="1" name="分公司2" /> <item id="12" fatherid="1" name="分公司3" /> </item> </root> 现在的问题是,怎么根据这个list,生成象如下多个文件: 1.main.xml <root> <item id="1" fatherid="" name="总部"/> </root> 2.zongbu.xml <root> <item id="10" fatherid="1" name="分公司1"/> <item id="11" fatherid="1" name="分公司2" /> <item id="12" fatherid="1" name="分公司3" /> </root> 3.fen1.xml <root> <item id="100" fatherid="10" name="分公司1的子公司1" /> <item id="101" fatherid="10" name="分公司1的子公司2" /> <item id="102" fatherid="10" name="分公司1的子公司3" /> </root> |
-- 作者:fairylily -- 发布时间:8/6/2007 3:53:00 PM -- 我尝试用递归等方法,都做不出来,请各位大虾指教啊 |
-- 作者:avaya2008 -- 发布时间:9/2/2007 10:07:00 AM -- 怎么做个xml数据库试验系统啊 然后进行优化的设计这些如何实现?谢谢了。 |
W 3 C h i n a ( since 2003 ) 旗 下 站 点 苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》 |
33.203ms |