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

xml操作

     protected void Button1_Click(object sender, EventArgs e)
        {
            //为response(star)节点 和  Cabins(f) cabin节点分别添加个
            string Response = "<TargetResponse> <Response mark=\"a\" test=\"E\"> <Cabins> <Cw C=\"L\" N=\"A\" D=\"75\" P=\"850\" K=\"6.5\" />  <Cw C=\"K\" N=\"A\" D=\"80\" P=\"900\" K=\"6.5\" />  </Cabins></Response> <Response mark=\"b\" test=\"E\"> <Cabins>  <Cw C=\"H\" N=\"A\" D=\"80\" P=\"900\" K=\"5\" />   <Cw C=\"B\" N=\"A\" D=\"90\" P=\"1020\" K=\"5\" />   <Cw C=\"Y\" N=\"A\" D=\"100\" P=\"1130\" K=\"5\" /> <Cw C=\"F\" N=\"A\" D=\"150\" P=\"1700\" K=\"6.4\" />   </Cabins>  </Response></TargetResponse>";
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.LoadXml(Response);
            XmlNodeList xnlist = xmlDoc.SelectSingleNode("TargetResponse").ChildNodes;
            foreach (XmlNode xn in xnlist)
            {
                XmlElement xnResponse = (XmlElement)xn;
                XmlNodeList xnCabins = xn.SelectSingleNode("Cabins").ChildNodes;
                XmlAttribute attrstart = xmlDoc.CreateAttribute("star");//创建节点
          &


相关文档:

用SAXReader解析xml文档

     使用SAXReader需要导入dom4j-full.jar包。
     dom4j是一个Java的XML API,类似于jdom,用来读写XML文件的。dom4j是一个非常非常优秀的Java XML API,具有性能优异、功能强大和极端易用使用的特点,同时它也是一个开放源代码的软件,可以在SourceForge上找到它。
 &n ......

java 对xml的增删改查

<?xml version="1.0" encoding="UTF-8"?>
<root>
 <person id="1">
  <username >xiaoma</username>
  <password>xiaoma</password>
 </person>
 <person id="2">
  <username>manager</username> ......

初学XML(一)

XML定义:由标记及其所标记的内容构成的文本文件。
XML作用:用来描述数据的结构,有效分离数据的结构和表示,可以作为数据交换的标准格式。
XML特点:1、可以自定义标记,标记名称是对所标记的数据内容含义的抽象,而不是数据的显示格式。
            &n ......

[转]XML详解 Schema

有人会问,DTD和Schema都是对XML文档的一种约束,为什么不就选其中之一,而又有Schema呢。因为DTD安全度太低了,也就是说它的约束定义能力不足,无法对XML实例文档做出更细致的语义限制。其实细心的人会发现,在DTD中,只有一个数据类型,就是PCDATA(用在元素中)和CDATA(用在属性中),在里面写日期也行,数字还行,字符 ......

c# 从XML读数据

C#
 DataSet ds = new DataSet();
ds.ReadXml(Server.MapPath("~/Config/User_yhlx_Jb.xml"));
DataView dv = ds.Tables[0].DefaultView;
//dv.RowFilter = "State=0";
this.DropDownList1.DataSource = dv;
this.DropDownList1.DataTextField = "text";
this ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号