本文介绍了将XML节点添加为第一个节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何帮助将不胜感激.我正在尝试找出一种将节点添加到现有XML文件的方法.情况如下:

我想将一个新的"B"节点作为第一个节点-在< A>之后.
每次我尝试添加新节点时,它都会追加到节点列表的底部.
现有文件类似于以下内容:

< A>
< B>
< C/>
< C/>
< C/>
</B>
< B>
< C/>
< C/>
< C/>
</B>
< B>
< C/>
< C/>
< C/>
</B>
</A>

Any help would be greately appreciated. I am trying to figure out a way to add a node to an existing XML file. Here''s the situation:

I want to and a new "B" node as the first node - immediately following <A>.
Each time I tried to add the new node, it''s appended to the bottom of the node list.
The existing file resembling the following:

<A>
<B>
<C />
<C />
<C />
</B>
<B>
<C />
<C />
<C />
</B>
<B>
<C />
<C />
<C />
</B>
</A>

推荐答案




这篇关于将XML节点添加为第一个节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-28 01:58
查看更多