Altova Mailing List Archives

Re: IXMLDOMDocument::transformNode Unspecified error

From: "Sam Hobbs" <samuel@------.--.---_------_------_--_----->
Date: 9/23/2005 6:44:00 PM
"Martin Honnen" <mahotrash@y...> wrote in message 
> Guess: you forgot to set async = false before loading the XSLT stylesheet.

I have looked at many samples, all of which "set async = false". My code 
does to; see:


> Usually neither script nor VB code to use MSXML is long

You got that right.

> if you show us both the VB and the JavaScript version I am rather sure we 
> can find the difference.

My VB code is:

    Dim XML As New MSXML2.DOMDocument
    Dim XSL As New MSXML2.DOMDocument
XML.async = False
XML.Load Root + "Security.xml"
XSL.async = False
XSL.Load Root + "Security.xsl"
On Error Resume Next
NodeText = XML.transformNode(XSL)
If Err.Number <> 0 Then
    Debug.Print Hex(Err.Number), Err.Description
    MsgBox Err.Description
    Exit Sub
End If

My JavaScript code is:

function Transform(From, To) {
// Load XML
var xml = new ActiveXObject("Microsoft.XMLDOM");
xml.async = false;
try {xml.load(From);}
catch(e) {
    return e + " error from xml.load";
// Load the XSL
var xsl = new ActiveXObject("Microsoft.XMLDOM");
xsl.async = false;
try {xsl.load(To);}
catch(e) {
    return e + " error from xsl.load";
// Transform
try {var NodeText = xml.transformNode(xsl);}
catch(e) {
    return e + " error from Transform";
return NodeText;



<Security Date="09/10/2005">
<User Type="Administrator"><Name>Debbie</Name></User>



<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="" 
<xsl:template match="/Security">
    <table border="2" bgcolor="cyan">
      <xsl:for-each select="Security">
        <td><xsl:value-of select="@Date"/></td>
    <table border="2" bgcolor="gray">
      <xsl:for-each select="User">
        <td><xsl:value-of select="Name"/></td>
        <td><xsl:value-of select="@Type"/></td>


These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.