[xsl] MSXML 4.0 (July) BUG: appendChild (RTF)

Subject: [xsl] MSXML 4.0 (July) BUG: appendChild (RTF)
From: "Alexander Gutman" <gutman@xxxxxxxxxxxxxxx>
Date: Sun, 29 Jul 2001 14:33:17 +0700
Hello, friends.

Let's use MSXML 3.0 and transform any XML document via this:

  <xsl:transform version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
    xmlns:msxsl="urn:schemas-microsoft-com:xslt"
    xmlns:x="urn:extension">

    <msxsl:script language="JScript" implements-prefix="x">
      var ver = '3.0';
      var xml = new ActiveXObject('Msxml2.DOMDocument.'+ver);
      xml.loadXML('&lt;new/&gt;');
      function add(rtf){
        xml.documentElement.appendChild(rtf);
        return true;
      }
    </msxsl:script>

    <xsl:template match="/">
      <result>
        <xsl:variable name="rtf"><one/><two/></xsl:variable>
        <xsl:if test="x:add($rtf)"/>
      </result>
    </xsl:template>

  </xsl:transform>

Then we obtain a "Type mismatch" error, as expected.
But if we replace the ver's value with '4.0'
and use MSXML 4.0 (July), then we obtain the following:

  The instruction at "0x69b6013c" referenced memory at "0x80004002".
  The memory could not be "read".

In MSXML 4.0 SDK we read:

  The DocumentFragment node has special, defined behavior
  for IXMLDOMNode insert operations that makes it especially
  convenient for developers. When an IXMLDOMDocumentFragment
  is inserted into a DOMDocument node (or other node that
  can take children), the children of the DocumentFragment are
  inserted into the node rather than the DocumentFragment itself.

I think, the above-reported bug is an attempt to realize this behavior.
Whenever the bug will be fixed, the above example will probably work.

-- 
Alexander E. Gutman

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread