Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 775677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:19:43+00:00 2026-05-14T19:19:43+00:00

How can i ask what version of MSXML an IXMLDOMDocument2 is? Given an IXMLDOMDocument2

  • 0

How can i ask what version of MSXML an IXMLDOMDocument2 is? Given an IXMLDOMDocument2 i need to create another document of the same version.

If you give an IXMLDOMDocument from different versions of MSXML, you will get an exception from msxml:

It is an error to mix objects from different versions of MSXML.

Microsoft internally can ask an interface what version of MSXML it came from, i need access to the same thing.


Consider the following hypothetical function written in pseudo-code:

String XMLTransform(IXMLDOMNode xml, String xsl)
{
    //Create a document to hold the xml
    IXMLDOMDocument2 xslDocument = new CoDOMDocument();

    //load the xsl string into the xsl dom document
    xslDocument.loadXML(xsl);

    //transform the xml
    return xml.transformNode(xslDocument);     
}

Problem is that if IXMLDOMNode comes from, say MSXML6. The created DOMDocument is from version 3 (because of Microsoft’s version dependance in MSXML). This will cause the

xml.transformNode()

to throw a COM exception:

It is an error to mix objects from different versions of MSXML.

Since Microsoft is able to ask an interface what version of MSXML it came from, i should be able to do the same thing, but how?

Alternativly, given an IXMLDOMNode, how can i construct an XMLDOMDocument object of the same version…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T19:19:44+00:00Added an answer on May 14, 2026 at 7:19 pm

    i figured out an answer (that works for MSXML version 6.0 at least).

    The interface type:

    DOMDocument60
    

    descends from IXMLDOMDocument30, while most people use IXMLDOMDocument or IXMLDOMDocument2.

    So if the passed interface does not at least support IXMLDOMDocument3, then i know the object is not at least version 6:

    procedure DoStuff(doc: IXMLDOMdocument2);
    begin
       if not (doc is IXMLDOMDocument3) then
           raise Exception.Create('badness');
    
       ...
    end;
    

    Or alternativly:

    procedure DoStuff(doc: IXMLDocument2);
    begin
       if not (doc is DOMDocument6) then
       begin
          DoStuffLegacyImplementation(doc);
          Exit;
       end;
    
       //Real implementation
       ...
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can i ask one user to create a folder through one dialog box
How can i find what version of browser a user is using and ask
Can I ask which version I should be using, in my older apps I
SHORT VERSION: How can I load classes during runtime from a bundle, when those
I started making a reproducible example to ask another question and can't even get
Is there a way I can ask Visual source safe to get all the
I am using GAE with python and I can ask users to sign in
Can I ask the user WHERE to install the application during install time? Most
Just want to ask can netbean IDE get connected to clearcase remote client server
im new with regexp, so can i ask for some assistance Using string.replace function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.