XML导入语法的后期绑定转换 [英] Late Binding conversion for XML import syntax

查看:82
本文介绍了XML导入语法的后期绑定转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Access应用程序,它实际上只是一堆办公应用程序(Word,Excel,Ppt& Outlook)的自动化服务器,接收导入的信息,并通过表格收集并生成各种文件.

I have an Access application that is really just an automation server for a bunch of office apps (Word, Excel, Ppt & Outlook), takes information imported, and gathered through forms and produces all kinds of files.

它不是传统意义上的数据库,而是一个远程文件用户在现场使用所有自动化技巧,然后在构建了所有需要的文件时将其丢弃.

It is not used as a database in the traditional sense, rather a remote file users utilize in the field for all the automation tricks, and then discard when they have all the files built then need.

因此最近,在这里的人们帮助我转换为后期绑定,以使我免于在目标系统上的笨拙引用中丧生,从而扼杀了该功能.效果很好!

So recently so folks here helped me out with converting to late binding as to save me from the brocken references on a target system killing the functionality. It is working great!

因此,现在我有一些xml导入代码,该代码需要设置xml v5才能运行.现在我以前遇到的问题是Excel,Powerpoint& Outlook对象库引用从Office版本更改为版本(2003 = 11.0、2007-12.0等),但是我想知道我是否在这里也会遇到同样的问题.为了使事情变得更复杂,我不知道服务器/操作系统是否可以在(XP,Vista,2003、2008 SP2等)上运行.老实说,我不知道这是否重要,所以这就是为什么我提到它.

So now I have some xml import code that requires xml v5 to be set in order to run. Now the problem I had before was the Excel, Powerpoint & Outlook object library references changing from office version to version (2003 = 11.0, 2007 - 12.0, etc), but I am wondering if I am going to have the same problem here. To make things more complicated I have no idea was Server/OS this may be run on (XP, Vista, 2003, 2008 SP2, etc). I honestly do not know if that will matter, so that is why I mention it.

因此,如果实际上会产生问题,那么有人对这种声明的后期绑定转换示例有想法吗?它似乎与创建和办公应用程序不同……

So, if it in fact will create a problem, then does anyone have an idea of a late binding conversion example for declarations for this? It doesn't seem to be the same as creating and office app...

Sub PullingDataFromNodes()
   dim xmlDoc as MSXML2.DOMDocument50
   dim xmlNodeList As MSXML2.IXMLDOMNodeList
   dim myNode as MSXML2.IXMLDOMNode

   Set xmldoc = New MSXML2.DOMDocument50
   xmldoc.async = False
   xmldoc.Load ("C:/SomeFolder/xml.xml")

   Set xmlNodeList = xmldoc.SelectNodes("//DataFieldNode")
   Set myNode = xmlNodeList.item(0)

   'etc...more of the same....pull data from node, place data into variable, then place 
   '  data in variable into recordset, use it to update table kind of thing

所以我试图与此一起使用CreateObject,但是它似乎不起作用....有人可以为此提供建议吗?

So I tried to use CreateObject with this, and it doesn't seem to work....can anyone offer and advice with this?

我可以使用argus时使用xmlImport ....但是这个特定的解决方案是通过Web应用程序提供数据的,而他们都没有为其嵌入模式,并且我没有样式表或.xsd

I use xmlImport when I can with argus....but this particular solution is for data is the provided through a web app for which they neither embed the schema, and I don't have a style sheet or .xsd

推荐答案

我有使用MSXML2.DOMDocument.3.0的类似代码,因此我将其切换为5,并且仍然可以使用.我不知道不同的版本.我只能建议您以这种方式尝试一下,看看会发生什么.

I had similar code which uses MSXML2.DOMDocument.3.0, so I switched it to 5 and it still works. I don't know about the different versions. I can only suggest you try it this way and see what happens.

Sub PullingDataFromNodes()
   dim xmlDoc As Object
   dim xmlNodeList As Object
   dim myNode As Object

   Set xmldoc = CreateObject("MSXML2.DOMDocument.5.0")
   xmldoc.async = False
   xmldoc.Load "C:/SomeFolder/xml.xml"

   Set xmlNodeList = xmldoc.SelectNodes("//DataFieldNode")
   Set myNode = xmlNodeList.item(0)

这篇关于XML导入语法的后期绑定转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆