vbs创建xml文件
上一篇 /
下一篇 2014-04-29 19:55:21
/ 个人分类:VBScript
'创建xml对象
2kf%I@j%v0M0
51Testing软件测试网 g5uB7P.FF"O-^v set xmldoc=createobject("Microsoft.XMLDOM")51Testing软件测试网e2zw ^+^9K '取消异步加载 Gk/U'W+p0xmldoc.async=false ]bVN
f.H0'创建处理指令 ^-k-ob%vc0 R`f:`,DAN0set newPI=xmldoc.createProcessingInstruction("xml","version='1.0'encoding='utf-8'")51Testing软件测试网#W2r"C#Q#s A/U3a xmldoc.appendchild(newPI) O,w9zGF5kZ0'创建根节点51Testing软件测试网S0n0{ZDJU)P VXZ set doc=xmldoc.createelement("userinfo")51Testing软件测试网x(o,X,??\W3Cc~%]f '创建CDATA节点 !_q"M]AC9QX0set newCD=xmldoc.createCDATASection("this is a CDDATA") `t?
GOw6H"]0doc.appendchild("newCD")51Testing软件测试网1S3rs\#y.[!f '创建注释 u6i9e(p7f0set newcomment=xmldoc.createcomment("comment") lXA/M7KcK0doc.appendchild(newcomment)51Testing软件测试网zQhQN '创建元素节点51Testing软件测试网D&T/m!je8`&\^n set newnode=xmldoc.createelemet("user")51Testing软件测试网,QW$IC;HI&g0t+K3VJ set newnode2=xmldoc.createelement("name")51Testing软件测试网gKdS T;\ '创建文本节点51Testing软件测试网*dE.Wm
\&| set textnode=xmldoc.createelement("jhon") :Y0|6Uq:k3N0f6MH0newnode2.appendchild(textnode) -Iy%w9jG|$u"U0newnode.appendchild(newnode2)51Testing软件测试网oQ&_ |