GNOME Bugzilla – Bug 319957
Can't parse stylesheet from copied doc.
Last modified: 2005-10-27 15:02:30 UTC
Steps to reproduce: Sorry for report against old libxml2/libxslt1 version. Report: libxslt can't parse stylesheet from copied doc. Sample: xmlDocPtr d1 = xmlReadMemory(str_data, str_len, "", 0, XML_PARSE_DTDATTR | XML_PARSE_DTDLOAD | XML_PARSE_NOENT); xsltStylesheetPtr s1 = xsltParseStylesheetDoc(d1); xmlDocPtr d2 = xmlCopyDoc(d1, 1); xsltStylesheetPtr s2 = xsltParseStylesheetDoc(d2); After executing of this code I got "normal" stylesheet s1, but "zero" stylesheet s2. Stack trace: Other information: xsltproc --version Using libxml 20616, libxslt 10112 and libexslt 810-CVS964 xsltproc was compiled against libxml 20616, libxslt 10112 and libexslt 810 libxslt 10112 was compiled against libxml 20616 libexslt 810 was compiled against libxml 20616
I found place in which xml_error raised. Breakpoint 2, __xmlRaiseError (schannel=0, channel=0x40b8fe14 <xmlParserWarning__internal_alias>, data=0x6380b5c8, ctx=0x6380b5c8, nod=0x0, domain=8, code=1549, level=XML_ERR_WARNING, file=0x0, line=0, str1=0x6380b560 "main.xsl", str2=0x0, str3=0x0, int1=0, int2=0, msg=0x40c36140 "failed to load external entity \"%s\"\n") at error.c:446 446 void *nod, int domain, int code, xmlErrorLevel level, This happend because I got in "read.xsl" imported file <xsl:import href="main.xsl"/>. Looks like in copied doc lost information about filepath.
"Sorry for report against old libxml2/libxslt1 version." Sorry I can't fix bugs in old versions. First retry with the latest ones i.e. libxml2-2.6.22 and libxslt-1.1.15 ! Then provide the full input reproducing the problem on the latest versions, i.e. stylesheet, complete runnable test C program (with main() and compiling with gcc) and potentially the input XML data too. Back to normal severity and priority level because bug can't be asserted on latest release and because it sounds not a sever problem. Daniel
You *must* make the copy before the first compilation anyway. Compiling the stylesheet is a *destructive* operation, it changes the input document. Daniel