Foxtable(狐表)用户栏目专家坐堂 → 请教xml


  共有2594人关注过本帖平板打印复制链接

主题:请教xml

帅哥哟,离线,有人找我吗?
大红袍
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/4/14 9:27:00 [只看该作者]

Dim str As String = ""
Dim cs() As String = {"第一列", "第二列"}
str &= "<root>"
For Each r As Row In Tables("表a").rows
    str &= "<表A>"
    For Each c As String In cs
        str &= "<" & c & ">" & r(c) & "</" & c & ">"
    Next
    str &= "</表A>"
Next
str &= "</root>"
msgbox(str)

Dim doc As New System.XML.XmlDocument()
doc.LoadXml(str)
Dim stream As new System.Io.FileStream("d:\test.xml", System.Io.FileMode.OpenOrCreate, System.Io.FileAccess.Write)
doc.Save(stream)
stream.Close()


 回到顶部
总数 13 1 2 下一页