|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Getting XML VersionI want to get my MSXML version from a vb.net program. I do it with the following piece of code, but I'm not very happy with that: Dim Version as String = "4.0" oXML = CreateObject("Msxml2.DOMDocument.4.0") 'Need version 4. If oXML Is Nothing Then 'Check the existing version oXML = CreateObject("MSXML2.DOMDocument.3.0") Version = "3.0" If oXML Is Nothing Then oXML = CreateObject("MSXML2.DOMDocument.2.6") Version = "2.6" If oXML Is Nothing Then oXML = CreateObject("MSXML2.DOMDocument") Version = "2.0" If oXML Is Nothing Then Version = "Not detected" End If End If End If End If Does anybody know a more elegant way to do this? Thanks, Norman Norman Chong wrote:
> I want to get my MSXML version from a vb.net program. The .NET framework has its own classes/implementations for XML parsing, XSLT, XPath, DOM, schema validation, you should not use MSXML from .NET. Show quoteHide quote > I do it with the It is not clear what you want to achieve, the latest version of MSXML is > following piece of code, but I'm not very happy with that: > > Dim Version as String = "4.0" > oXML = CreateObject("Msxml2.DOMDocument.4.0") 'Need version 4. > If oXML Is Nothing Then 'Check the existing version > oXML = CreateObject("MSXML2.DOMDocument.3.0") > Version = "3.0" > If oXML Is Nothing Then > oXML = CreateObject("MSXML2.DOMDocument.2.6") > Version = "2.6" > If oXML Is Nothing Then > oXML = CreateObject("MSXML2.DOMDocument") > Version = "2.0" > If oXML Is Nothing Then > Version = "Not detected" > End If > End If > End If > End If > > Does anybody know a more elegant way to do this? MSXML 6 for instance. And MSXML 3, 4, 5, 6 can all coexist on the same system. The programming id MSXML2.DOMDocument can be bound to MSXML 3 depending on the installation, with the normal IE 6 installation it is bound to MSXML 3. Martin Honnen schrieb:
> Sorry if it was unclear what I want to do - I try it again ;-)> It is not clear what you want to achieve, the latest version of MSXML is > MSXML 6 for instance. And MSXML 3, 4, 5, 6 can all coexist on the same > system. The programming id MSXML2.DOMDocument can be bound to MSXML 3 > depending on the installation, with the normal IE 6 installation it is > bound to MSXML 3. > The program should check, if there is MSXML 4.0 installed (it has to do this for another application, which needs 4.0 - That's why I started with 4.0 in my code), if not it should get the next lower version which is installed and show it within a MessageBox.
LsaOpenPolicy : Attempted to read or write protected memory
Cant seem to filter Dataset table by a value Scope misunderstanding Database creation problems regex.replace and trim DataGridView Edit row marker difference between MyBase.Closing and MyBase.FormClosing set itemheight in listbox Filling TreeView with Recursive Function ? Application.EnableVisualStyles() still required in version 2.0 |
|||||||||||||||||||||||