[xsl] msxml weirdness

Subject: [xsl] msxml weirdness
From: "Wineman, Corey J." <Corey.Wineman@xxxxxxxxx>
Date: Thu, 24 Oct 2002 11:17:12 -0400
Hello,

I am trying to use MSXML to convert some XML data into HTML files. I have a very simple XML file and I want to produce an index HTML file containing summaries of data. These summaries will then link to individual HTML pages with more complete information for each of the nodes. By loading up the data.xml & summary.xsl, calling the methods transformNode, then the transformNodeToObject, creation of the index page works fine. 

To create the individual pages I get the nodes by calling the getElementsByTagName method and loop through them. I then try to apply the same steps as above, but substituting full_info.xsl to create different HTML. It works in some cases, but as I try to add more HTML markup information to the xsl file my program crashes or behaves strangely.

I have included a simplified version of full_info.xsl that for some reason causes a crash. It looks valid to me, so if anyone could tell me what's wrong, I would appreciate it.

The crash occurs when I include the second table data("<td>") in the last table. If I delete it, it works. Why? Actually it doesn't always crash, sometimes, it just fails to create the HTML when I call transformNodeToObject. I think it depends if I am in debug or release mode.

-Corey

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>

<xsl:template match="my_xml_node">
<html>
    <head>
        <title>FULL INFO</title>        
    </head>
    <body>
        <table border="0" width="100%">
            <tr>
                <td align="middle" valign="top">
                    <font size="6"><strong>TOP O' PAGE, some stuff</strong></font>
                </td>
            </tr>
        </table>
        
        <table border="0" cellpadding="5" width="100%">
            <tr>
                <td align="middle" width="40%">
                    Second table, some stuff here.
                </td>
            </tr>                
        </table>
        
        <table>
            <tr>
                <td>
                    Hello.
                </td>
                
                <!-- THIS IS THE THING THAT CAUSES CRASH, IF DELETED, NO PROBLEMS-->
                <td>
                    Goodbye.
                </td>
                <!-- !!! -->
                
            </tr>
        </table>
        
    </body>
</html>
</xsl:template>

</xsl:stylesheet>

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


Current Thread