MSXML GetHashCode 3

Does anyone know how to get a unique identifier for an IXMLNode for MSXML? I’ve tried googling around for this without finding a solution. In Mozilla I can just use expando properties but expandos do not work when using ActiveX objects.

I think I’ll probably have to use an array and then use the index in the array as the hash code but that will make it O(n) and that would totally suck for something as common as this.

  • aaron

    There’s a function to do this called – ironically enough – uniqueid(). witness:

    I’m trying to figure out how to get at it through old school msxml, let you know what I find.


  • aaron

    Yeah, there is probably a way better way to get at that IXTLRuntime object that I can’t find right now, but you could always do something horrific like this:

    var source = new ActiveXObject(“Msxml2.DOMDocument”);
    source.async = false;
    source.resolveExternals = false;

    // Load style sheet.
    var stylesheet = new ActiveXObject(“Msxml2.DOMDocument”);
    stylesheet.async = false;
    stylesheet.resolveExternals = false;
    stylesheet.loadXML(‘<xsl:stylesheet xmlns:xsl=”” version=”1.0″>’ +
    ‘<xsl:output omit-xml-declaration=”yes” />’ +
    ‘<xsl:template match=”*”><xsl:value-of select=”generate-id(.)” /></xsl:template>’ +

    // Fill a div tag with the result of the transform

  • IE Team

    Explorer will always be the best browser. Don”t you dare install Firefox or we will sue you.

    IE Team