GNOME Bugzilla – Bug 528211
Elements of a DTD are not seen
Last modified: 2008-06-05 14:06:29 UTC
Please describe the problem: I would appreciate if someone let me know whether this is a real bug or I need to fix my source (apologies for the noise in this case). My build preprocesses an xml file with a stylesheet in order to generate a pair of files *.h/*.c: xsltproc --path <path1> -o html4dtd.h <path2>/html4dtd.xsl html_dtd.xml This generation was performed fine until recently (I'm on Debian Unstable) when libxslt was upgraded to 1.1.23 from 1.1.22. With this version, the generated files are mostly empty, as if the elements of the xml file were not seen. I tracked this problem to the commit r1451 of libxslt, fix to "superfluois re-generation of keys" by William Brack. I suspect the line keys.c:580 is the origin of the modified behavior -- the newly-introduced routine 'xsltInitAllDocKeys' is frequently called *before* the number of keys 'ctxt->nbKeys' is computed for the document by 'xsltCountKeys'. -- 1.1.22 always works for me. -- 1.1.23 built without 'XSLT_REFACTORED_KEYCOMP' works for me. -- 1.1.23, with the following patch (counting keys *before* evaluating global variables) fixes it for me (but I didn't test beyond that). --- transform.c 2007-06-17 22:45:22.000000000 +0200 +++ transform.c-new 2008-04-15 14:29:41.000000000 +0200 @@ -6012,12 +6012,12 @@ if (params != NULL) { xsltEvalUserParams(ctxt, params); } - xsltEvalGlobalVariables(ctxt); - #ifdef XSLT_REFACTORED_KEYCOMP xsltCountKeys(ctxt); #endif + xsltEvalGlobalVariables(ctxt); + ctxt->node = (xmlNodePtr) doc; ctxt->output = res; ctxt->insert = (xmlNodePtr) res; Steps to reproduce: (Unfortunately, I need first to check out with our vendor whether I may submit his source code for reproduction.) Actual results: Expected results: Does this happen every time? yes Other information:
I really need a test case for this. There is another bug https://bugzilla.redhat.com/show_bug.cgi?id=442097 which has been introduced by that change, and your patch does not fix it. Without a test case, I cannot handle your bug report. Daniel
My particular problem is fixed by the 1.1.24. (Sorry, our software vendor haven't agreed to provide their files for bug reproduction, and working out an independent example demanded an effort I couldn't afford.)