对了,结点信息类似如下
<?xml version="1.0" encoding="gb2312"?>
<lists>
  <list>
    <id>1</id>
    <username>冯奎</username>
    <time>01-4-23 18:26:56</time>
    <homepage>http://www.getjob.com.cn</homepage>
    <email>[email protected]</email>
    <context>我的留言</context>
  </list>
  <list>
    <id>2</id>
    <username>妞妞</username>
    <time>01-6-23 18:26:56</time>
    <homepage>http://www.neworiental.org</homepage>
    <email>[email protected]</email>
    <context>测试留言</context>
  </list>
</lists>

解决方案 »

  1.   

    小弟最近也在作一个动态树型数据菜单的,增删改和移动哈!jsp +javaBean+xml +oracle
    郁闷的不行了,希望高手能给与指点
      

  2.   

    我也正在做和你一样的工作,如果你先做出来麻烦联系我,[email protected]
    QQ21359875
    我如果搞出来就到你这里来回贴!
      

  3.   

    你的三个问题其实是一个问题,这是由两或三个类组成.(我这里由于写程序不方便,只说一下思路).一个类是控制类,控制数据的流向,也即是动作类.一个类是解析类,解析XML中提取的数据.然后就是具体的数据存储的XML文件.
    对于这种菜单,在写程序的过程中是经常遇到的.解决的方法各有不同.可以从网上找一些例子来照着写.
      

  4.   

    用jdom????建xml文件:
    http://www.java-cn.com/technology/technology_detail.jsp?id=2913
      

  5.   

    一句??,jdom的好??就是????. ?@是我??要建的xml: <?xml version="1.0" encoding="UTF-8"?> 
    <car vin="123fhg5869705iop90"> 
    <!--Description of a car--> 
    <make>Toyota</make> 
    <model>Celica</model> 
    <year>1997</year> 
    <color>green</color> 
    <license state="CA">1ABC234</license> 
    </car> ???浜??访矗?let us go! 第一步,??建根元素 Element carElement = new Element("car"); 
    Document myDocument = new Document(carElement); 因??一?? XML 文?n必??一直有一??唯一的根元素,所以 Document ?? Element 放在它的??造器中。 第二步,添加一?? Attribute carElement.addAttribute(new Attribute("vin", "123fhg5869705iop90")); 第三步,添加其他元素 carElement.addContent(new Element("make").addContent("Toyota")); carElement.addContent(new Element("model").addContent("Celica")); 
    carElement.addContent(new Element("year").addContent("1997")); 
    carElement.addContent(new Element("color").addContent("green")); 
    carElement.addContent(new Element("license").addContent("1ABC234").addAttribute("state", "CA")); 第四步,添加一?l?]?? carElement.addContent(new Comment("Description of a car")); 第五步,?x一??子元素 Element yearElement = carElement.getChild("year"); 第六步,?h除子元素 boolean removed = carElement.removeChild("year"); 第七步,存?P FileWriter writer = new FileWriter("/some/directory/myFile.xml"); 
    outputter.output(myDocument, writer); 
    writer.close();