[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: msxml weirdness

Subject: RE: msxml weirdness
From: "Wineman, Corey J." <Corey.Wineman@xxxxxxxxx>
Date: Thu, 24 Oct 2002 12:16:25 -0400
domdocument40
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:  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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.