易截截图软件、单文件、免安装、纯绿色、仅160KB

如何对一xml格式的字符串分析?

http://topic.csdn.net/t/20021102/16/1142056.html
use   classes   in   System.Xml   namespace,   for   example   (assume   your   xml   is   in   string   s   and   it   contains   an   xmlns   definition):  
   
  <ns:vi   id="New_main"   xmlns:ns="whatever">  
  <ns:node   Expandable="checkOnce"   Selected="true"   ID="a1">  
  root<ns:node   ID="a2">  
  Node1  
          </ns:node>  
  </ns:node>  
  </ns:vi>  
   
   
  string   s   =   "................";  
   
  XmlDocument   xmldoc   =   new   XmlDocument();  
  xmldoc.LoadXml(s);  
   
  XmlNamespaceManager   xnm   =   new   XmlNamespaceManager(xmldoc.NameTable);  
  xnm.AddNamespace("ns","whatever");  
   
  XmlNode   node   =   xmldoc.SelectSingleNode("//ns:node[@ID='a1']",   xnm);  
  if   (node   !=   null)  
  {  
      XmlAttribute   att   =   xmldoc.CreateAttribute("bbi");  
      att.Value   =   "xxxxxxxxxxx";  
      node.Attributes.Append(att);  
  }


相关文档:

XML 增删改查

using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Xml;
using System.Data;
public class Cls_XML
{
    #region 创建xml文件
    /// <summary>
    /// 创建xml文件
    /// ......

flex 操作xml 实现增删改查

详细介绍Flex中操作XML(上)
2009年12月30日 星期三 12:05
一 在介绍Flex中操作XML之前,首先简单介绍下XML中的基本术语。   
元素:XML中拥有开始标签和结束标签的这一块称为“元素”   
节点:把XML元素与文本结合起来统称为节点   
根节点:位于整个XML文 ......

C#修改XML的简单例子

接上一篇《C#写XML的简单例子》
这个例子要修改XML文件中结点的属性和和元素的文本
1 原xml文件 bookstore.xml
<?xml version="1.0" encoding="gb2312"?>
<bookstore>
  <book genre="love" ISBN="1234123">
    <title>who am i </title>
    &l ......

C#显示XML元素内容的简单例子

接上一篇
显示所有结点的内容
1 原xml文件 bookstore.xml
<?xml version="1.0" encoding="gb2312"?>
<bookstore>
  <book ISBN="1234123">
    <title>who am i </title>
    <author>who</author>
    <price> ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号