473,394 Members | 1,806 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to detect absence of MSXML 6.0 Parser

JJA
I'm working on part of a site (see http://gis.cbmiweb.com/MDWmaps/default.asp)
where I thought everything was working fine for IE6, IE7 and Firefox.

Recently, I discovered this failed for an IE7 user. The fix for that
situation was to install the MSXML6.0 Parser (I would have thought
that IE7 should have ensured the corresponding presence of that
component).

Q. Is there a simple way to test for the absence of this component?
I'm thinking I could "degrade gracefully", avoid the scripting error
that occurs and maybe issue an alert or something that suggests they
download this component.

Apr 25 '07 #1
1 6816
JJA
Here is what I found somewhere and adapted to my needs:

function testMSXml() {
var xmlDocument = null;
var fragment;
var target;
var highestVersion = 0;
var currentVersion;
var versionStrings = [
'Msxml2.DOMDocument.3.0',
'Msxml2.DOMDocument.4.0',
'Msxml2.DOMDocument.5.0',
'Msxml2.DOMDocument.6.0',
];
var requiredVersion = 'Msxml2.DOMDocument.6.0';
if (ie) {
if (typeof ActiveXObject != 'undefined') {

for (var v = 0; v < versionStrings.length; v++) {
try {
currentVersion = versionStrings[v];
xmlDocument = new ActiveXObject(currentVersion);
highestVersion = currentVersion;
}
catch (e) {
break;
}
}
}

if (highestVersion && highestVersion == requiredVersion) {
fragment = ''; // 'MSXML test: Found support
for ' + highestVersion;
return;
}
else {
if (!highestVersion) highestVersion = 'NO SUPPORT FOUND!';
fragment = 'Required version of MSXML is: ' +
requiredVersion + '. Found version: ' + highestVersion;
}
var para = document.createElement("p");
var target = document.getElementById("countyLeaders");
target.appendChild(para);
var txt = document.createTextNode(fragment);
para.appendChild(txt);
countyLeaders.style.visibility = "visible";
aboutMSXML.style.visibility = "visible";
countyLeaders.style.color = "black";
}
}

Apr 27 '07 #2

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

Similar topics

1
by: Alastair Cameron | last post by:
I have a VB (VB6, not .NET) application that reads an XML file (using MSXML v3.2 parser); the XML file contains a reference to an external DTD. The DTD has numerous enumerated attribute...
1
by: OKI | last post by:
Hi. I´ve made a XML parser using MSXML2.LIB in a computer. When i´ve tried to run it in another one like that: HRESULT hr = CoCreateInstance(CLSID_DOMDocument, NULL, CLSCTX_INPROC_SERVER,...
2
by: Bill Cunningham | last post by:
For some reason I can't find on my win98 IE5 or 5.5 the msxml2.5 parser that's supposed to be there. Does anyone know where I can get one? Also if I was running my linux system. Where could I get...
1
by: Olav | last post by:
I have an element that looks like this: <PhoneNumber>&lt;NUMBER&gt;</PhoneNumber> I would like to have the content returned as "<NUMBER>". Not only don't I get the character references resolved,...
19
by: Mark Miller | last post by:
QUESTION: Does anyone know how I can use v2.6 of the MSXML parser with .NET? BACKGROUND: I "Web to Print" process that allows our clients (newspapers) to export their data and pass it thru a...
7
by: Michael | last post by:
Hi, I have a problem parsing XML file using XSLT stylesheet by using : using System.Xml; using System.Xml.XPath; using System.Xml.Xsl; // load Xsl stylesheet XslTransform myXslTrans = new...
4
by: JohnArgost | last post by:
I try to learn how to parser XML files. Should I learn MSXML or .NET (system.xml) or both. Is MSXML an old technology which is replaced by .NET? Thanks in advance.
4
by: K | last post by:
I've an XML file in UTF-8. It contains some chinese characters ( both simplified chinese and traditional chinese). In loading the XML file with MSXML parser, I used the below code to retrieve...
13
by: yawnmoth | last post by:
<http://www.quirksmode.org/book/printable/xmlhttp.txtshows two alternatives to Microsoft.XMLHTTP - Msxml2.XMLHTTP and Msxml3.XMLHTTP. If my understanding is correct, the different numbers refer to...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.