After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 319957 - Can't parse stylesheet from copied doc.
Can't parse stylesheet from copied doc.
Status: RESOLVED INCOMPLETE
Product: libxslt
Classification: Platform
Component: general
1.1.12
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2005-10-27 09:55 UTC by Vasily Chekalkin
Modified: 2005-10-27 15:02 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Vasily Chekalkin 2005-10-27 09:55:23 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
Comment 1 Vasily Chekalkin 2005-10-27 10:06:34 UTC
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.
 
Comment 2 Daniel Veillard 2005-10-27 15:00:30 UTC
"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
Comment 3 Daniel Veillard 2005-10-27 15:02:29 UTC
You *must* make the copy before the first compilation anyway. Compiling the
stylesheet is a *destructive* operation, it changes the input document.

Daniel