RE: [xsl] msxml weirdness

Subject: RE: [xsl] msxml weirdness
From: "Wineman, Corey J." <Corey.Wineman@xxxxxxxxx>
Date: Thu, 24 Oct 2002 12:16:25 -0400
Serge,

	Yeah, same thing. That was really just a simple example. I think it really just happens as I add to complexity to the XSL. It seems like its not the text in the TD, but the fact that there are 2 causes 

Here is the code where it screws up. This is where I loop through my nodes, and try to create an individual HTML page for each node. In release mode, it fails to create the HTML, but doesn't crash. In debug, it throws an exception on the CreateInstance method.
			
-Corey

			hr= pXSLDoc.CreateInstance(__uuidof(DOMDocument40));
			pXSLDoc->async = VARIANT_FALSE; // The default is true.

			/** This returns hr == -1. Is that a problem? */
			hr = pXSLDoc->load( m_FullInfoXSL );			

			_bstr_t str = pIDOMNode->transformNode(pXSLDoc);

			/**Exception here */
			hr = pXMLOut.CreateInstance(__uuidof(DOMDocument40));

			hr = pIDOMNode->transformNodeToObject( pXSLDoc, pXMLOut.GetInterfacePtr());
			CString newFile;
			newFile.Format( "%s%s%s", m_tempWebDir, caseName, ".html");
			hr = pXMLOut->save( newFile.GetBuffer( 100 ) );

-----Original Message-----
From: Serge I. Zolotukhin [mailto:serge@xxxxxxxxx]
Sent: Thursday, October 24, 2002 11:54 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [xsl] msxml weirdness


Hello.

Tell me what happens if you put that TD element _before_ first TD (as
firstChild of TR)? Same?

Serge I. Zolotukhin
____________________________________________________________
production engineer | serge@xxxxxxxxx | http://www.design.ru


> 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
>


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


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


Current Thread