Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Msxml2.DOMDocument Versioning >Thread Next - Re: Msxml2.DOMDocument Versioning Re: Msxml2.DOMDocument VersioningTo: NULL Date: 5/3/2005 6:53:00 PM
mike wrote:
> A couple weeks ago I had a problem where some users were getting
> "Automation Server Error" messages on a page specifically trying to
> address an MSXML object as follows:
>
> var src = new ActiveXObject("Msxml2.DOMDocument.4.0");
>
> Some users had 3.0, some 4.0, and some 5.0.
>
> If I change the page as follows:
>
> var src = new ActiveXObject("Msxml2.DOMDocument");
>
> does this simply use the latest version or do I have to sniff the users
> machine to find out what to call?
You can use try/catch e.g.
var xmlDocument;
try {
xmlDocument = new ActiveXObject("Msxml2.DOMDocument.5.0");
}
catch (e) {
try {
xmlDocument = new ActiveXObject("Msxml2.DOMDocument.4.0");
}
catch (e) {
xmlDocument = new ActiveXObject("Msxml2.DOMDocument.3.0");
}
}
Msxml2.DOMDocument is bound to Msxml2.DOMDocument.3.0 or earlier as
MSXML 4 and 5 only use version specific program ids.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
