有一个名称为ABC的XML文件,结构如下
<?xml version=\"1.0\" ?>
<img src="images/01.jpg" width="200" height="200" />
<img src="images/02.jpg" width="200" height="200" />
<img src="images/03.jpg" width="200" height="200" />我现在想在这个基础上开始增加.<?xml version=\"1.0\" ?>
<img src="images/01.jpg" width="200" height="200" />
<img src="images/02.jpg" width="200" height="200" />
<img src="images/03.jpg" width="200" height="200" />
<img src="images/04.jpg" width="200" height="200" />
<img src="images/05.jpg" width="200" height="200" />
...在程序里应该怎么写?

解决方案 »

  1.   

    你这个XML文档格式一点都不标准,只能通过过写入文本的形式插入节目。
    参与一下streamwrite类。
      

  2.   

    LZ请看 http://www.cnblogs.com/legoras/articles/814407.html
      

  3.   

    标准的XML文档起码要有文档声明
    一个根节点,然后根节点里才是子节点,一个xml文档有仅有一个根根点。
    就象下面的<?xml version="1.0"?>
    <root>
       <img   src="images/01.jpg"   width="200"   height="200"   />
       <img   src="images/02.jpg"   width="200"   height="200"   />
       <img   src="images/03.jpg"   width="200"   height="200"   />
    </root>