473,505 Members | 13,807 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting XML Version

Hi,

I 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

Nov 6 '06 #1
2 1674
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.
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?
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.

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Nov 6 '06 #2

Martin Honnen schrieb:
>
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.
Sorry if it was unclear what I want to do - I try it again ;-)
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.

Nov 6 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2148
by: Patrik Carlsson | last post by:
I have a problem using Xerces with a template for a generic page-header getting a sub-tree as argument. The same stylesheet is working flawlessly in IE and Mozilla, though it would be nice to have...
2
6886
by: Eyal | last post by:
Hey, I would appriciate if anyone can help on this one: I have a java object/inteface having a method with a boolean parameter. As I'm trying to call this method from a javascript it fails on...
0
1389
by: shawnk | last post by:
I downloaded and installed the new SQL Server Express Manager tool but it had problems with the latest 'released version of .NET (version I have is 2.0.40607). I looked on MSDN websites but did...
2
2095
by: nfr | last post by:
I keep getting the following warning in my compile: Warning: The dependency 'WBWebServices, Version=1.0.1289.13943, Culture=neutral' in project 'WBWin' cannot be copied to the run directory...
2
56889
by: kris | last post by:
Hello, We're porting some old code to our new C# .NET project and are having trouble getting the file version of a non-.NET EXE file using C# .NET code. In our old code, we were using the...
2
1992
by: William Gower | last post by:
I am trying to display a page that has a data grid on it. I get this message Description: An error occurred during the processing of a configuration file required to service this request....
2
1639
by: JIM.H. | last post by:
Hello, I know the user I give in the connection string is the database admin, why am I getting the following message? Server Error in '/' Application...
0
1381
by: MSK | last post by:
Dear all, Continued to my earlier mail regarding "Breaking points are not getting hit in ASP.NET " , I got some idea from net. Can anyone give me more idea on this? Just to remind the issue:...
2
3803
by: Dylan Parry | last post by:
Hi, Is there a way of getting the date that an assembly was last compiled? I am trying to help myself to remember what version of a particular assembly my Web applications are using, so I've...
8
6262
by: lawrence k | last post by:
I've installed Apache 1.3.36 on my Redhat EL 3 machine. Now I'm trying to install PHP 5.1.4. I can not get the ./configure command to work. I keep getting this error: configure: error: Invalid...
0
7213
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7098
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7366
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5610
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4698
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3187
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
406
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.