Foxtable(狐表)用户栏目专家坐堂 → xml文件提取问题


  共有3915人关注过本帖树形打印复制链接

主题:xml文件提取问题

帅哥,在线噢!
有点蓝
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:109489 积分:557107 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2022/3/10 22:45:00 [显示全部帖子]

有些Patch节点不是数组

Dim dlg As New OpenFileDialog '定义一个新的OpenFileDialog
If dlg.ShowDialog = DialogResult.Ok Then '如果用户单击了确定按钮
    Dim xml As String = FileSys.ReadAllText(dlg.FileName,Encoding.UTF8)
    Dim xo As Foxtable.XObject = Foxtable.XObject.Parse(xml)
    
    For Each bm As JToken In  xo("Separations")("Separation")
        Output.show(bm("#text"))
        If Typeof bm("Patches")("Patch") Is jobject
            Output.Show(bm("Patches")("Patch")("#text"))
        Else
            For Each yg As JToken In bm("Patches")("Patch")
                Output.Show(yg("#text"))
            Next
        End If
    Next
    
End If

 回到顶部
帅哥,在线噢!
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:109489 积分:557107 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2022/3/11 9:38:00 [显示全部帖子]

if yg("Width ") isnot nothing then
if yg("Width ")("#text") isnot nothing then
output.show( yg("Width ")("#text"))
end if
end if

 回到顶部