标题: 请教各位哥哥姐姐,2个问题!!! [打印本页] 作者: skyhen 时间: 2006-7-27 15:40 标题: 请教各位哥哥姐姐,2个问题!!! 1、
Set doc = XMLUtil.CreateXML()
doc.LoadFile "c:\example.xml"
Set root = doc.GetRootElement()
Set children = root.ChildElements()
Set child = children.ItemByName("Cartman")
numOfChildren = 0
While Not child Is nothing
numOfChildren = numOfChildren+1
Set child = children.ItemByName("Cartman",numOfChildren+1)
Wend
msgbox "The number of children named Cartman is " & numOfChildren
2、
Set doc = XMLUtil.CreateXML()
doc.LoadFile "c:\example.xml"
Set root = doc.GetRootElement()
Set attribs = root.Attributes()
numOfAttr = attribs.Count()
i = 1
While i <= numOfAttr
Set attr = attribs.Item(i)
nameStr = attr.Name()
valStr = attr.Value()
attrStr = attrStr + nameStr+"="+chr(34)+valStr+chr(34) + " "
i = i+1
Wend
msgbox "Attributes: " + attrStr
小弟想知道以上2段代码都实现了什么功能啊,请各位给小弟一点指导。
小弟先此谢谢了作者: xiaonan 时间: 2006-7-27 15:44
你可以自己调试一下啊.两段内容差不多,都是对xml文件的处理