[xslt] xsltParseStylesheetDoc Crash



I am trying to perform an XSL transformation on an XML document
and XSL document in memory.

I use xmlParseMemory and xslParseMemory to create the xmlDocPtrs
for the two documents, then I want to use xsltParseStylesheetDoc to
create the XSL style sheet, and xsltApplyStylesheet to transform it.

The two strings I am inputting are known good documents, and when
I use xmlDebugDumpDocument to dump them to stdout, they look
fine. However, when I call xsltParseStylesheetDoc on the 
xmlDocPtr for my XSL, I get a crash with this output:
 
#2  0x418dfe1a in __pthread_sighandler () from /lib/libpthread.so.0
#3  <signal handler called>
#4  xsltGatherNamespaces (style=0x82c7e78) at xslt.c:1302
#5  0x402369cb in xsltParseStylesheetImportedDoc (doc=0x82c7e78) at xslt.c:1980
#6  0x40236a32 in xsltParseStylesheetDoc (doc=0xfffffe00) at xslt.c:2003

I have been trying to solve this for quite some time now, and came up empty.
Below is the code I am using (Note to non-Qt devels, QCString is equivalent
to a char*, I am sure this is not the problem anyway since the
xmlDebugDumpDocument works?)

Please CC me on replies since i am not subscribed to the list.

-----------------------------------------------------------------------------------

	xsltStylesheetPtr style_sheet = NULL;
	xmlDocPtr xmlDoc, xslDoc, resultDoc;
		
	xmlInitMemory();
	xmlLoadExtDtdDefaultValue = 1;
	xmlSubstituteEntitiesDefault(1);

	// Convert QString into a C string
	QCString xmlCString = xmlString.latin1();
	QCString xslCString = xslString.latin1();
	
	// Read XML docs in from memory
	xmlDoc = xmlParseMemory( xmlCString, xmlCString.length() );
	xslDoc = xmlParseMemory( xslCString, xslCString.length() );
	
	// Debug output shows fine
	xmlDebugDumpDocument( stdout, xmlDoc);
	xmlDebugDumpDocument( stdout, xslDoc);
	
	if( xslDoc != NULL && xmlDoc != NULL )
	{
		//Crash Here!
		style_sheet = xsltParseStylesheetDoc( xslDoc );

-- 
Jason Keirstead, BCS
http://www.keirstead.org



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]