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

OpenXml开发 一个应用Xml的例子


  3private XmlDocument xmlDoc;
  4        //load xml file
  5        private void LoadXml()
  6        {
  7            xmlDoc=new XmlDocument();
  8            xmlDoc.Load("User.xml");
  9        }
 10        //添加节点
 11        private void AddElement()
 12        {             
 13            LoadXml();
 14            XmlNode xmldocSelect=xmlDoc.SelectSingleNode("user");             
 15            XmlElement el=xmlDoc.CreateElement("person"); //添加person节点
 16            el.SetAttribute("name","风云"); //添加person节点的属性"name"
 17            el.SetAttribute("sex","女");   //添加person节点的属性 "sex"
 18            el.SetAttribute("age","25");   //添加person节点的属性 "age"             
 19             XmlElement&n


相关文档:

xml/properties文件的相互保存转化

/*
练习使用java.util.properties类包来操作propertes及XML文件,通过store方法的调用可实现xml/properties文件的相互保存转化
*/
import java.util.*;
import java.io.*;
public class TestPropertes
{
public static void main(String[] args) {
   Properties pp = new Properties();
   Fi ......

XML第二课

wsdl.xml文件
<?xml version="1.0" encoding="UTF-8" ?>
<definitions  name="MobilePhoneService"
     targetNamespace="www.mobilephoneservice.com/MobilePhoneService-interface"
     xmlns="http://schemas.xmlsoap.org/wsdl/"
     ......

XML的创建

       声明
        /// <summary>
        /// XML文档
        /// </summary>
        XmlDocument xmldoc;
 &n ......

asp读取XML文件

<%
'
Set http=Server.CreateObject("Microsoft.XMLHTTP")
http.Open "GET","http://127.0.0.1/1.xml",False
http.send
Dim xml
Set xml = Server.CreateObject("Microsoft.XMLDOM")
xml.async = False
'xml.load (Server.MapPath("1.xml")) '如果不是远程文件直接这一步
xml.Load(http.ResponseXML)
Dim t ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号