This is a very strange error that seems like it may be processor specific. When processing the attached xml (which consists only of an info element in an article element) with xsltproc, the following error message is generated: "Request for title of element with no title: code (contained in )". No code element is present in the xml and no customization layer is involved. Processing is being ran with
xsltproc c:\stylesheets\docbook-xsl-1.79.1\epub\docbook.xsl manual.xml
What makes this bizarre is that it doesn't happen everytime. Running it multiple times with the repeat option (which runs it 20 times) it only happens a little under half the time. I have tried installing different versions of xsltproc, and it occurs on all of them (but at a different frequency - the 32bit windows versions available here caused it everytime in a series of tests). When this error occurs, it adds an extra itemref to the spine in content.opf. I haven't been able to figure out any way to reliably trigger the error on every run.
I ran a test using lxml in python and ran the processing 600 times and it did not occur there once, so it seems to be processor specific.
I would call this entirely an xsltproc bug, but using version 1.78 of the stylesheets, it does not occur at all. It also doesn't occur using the namespaced stylesheets. This is almost certainly a bug in xsltproc, but something in the new version of the stylesheets is triggering this bug. I really don't understand what is going on here, especially as it is intermittant.
I have attached the xml being processed as well as the message output of the above xsltproc command and the resulting documents from one run that produced the error.
Running xsltproc --version with the version that caused the error everytime, the output was
Using libxml 20708, libxslt 10126 and libexslt 815
xsltproc was compiled against libxml 20706, libxslt 10126 and libexslt 815
libxslt 10126 was compiled against libxml 20706
libexslt 815 was compiled against libxml 20706
the version that only caused it some of the time (packaged with strawberry per 5.22.0) gave
Using libxml 20902, libxslt 10128 and libexslt 817
xsltproc was compiled against libxml 20902, libxslt 10128 and libexslt 817
libxslt 10128 was compiled against libxml 20902
libexslt 817 was compiled against libxml 20902
I'm not able to duplicate this bug. I'm running this version: Using libxml 20902, libxslt 10128 and libexslt 817
I ran it 30 times with no error on Windows 10.
The epub/docbook.xsl file was modified between 1.78.1 and 1.79.1 to better handle a DocBook 5 document in the non-namespaced stylesheet. Since this problem does not occur when processing with the namespaced stylesheet, I suspect that xsltproc's processing of the the namespaced document into a namespace-stripped document in memory and then applying templates on that is producing this error. I always recommend that people run the namespaced stylesheets on DocBook 5 so as to avoid these kinds of obscure issues with the namespace stripping process.
That's unfortunate that you can't reproduce it. I was hoping for some explanation of what is causing this, as it is such a strange error. I can't track it down any better than I have stated either, so can't provide any more specific information. I suppose that it is possible that the error is somewhere in one of the external libraries xsltproc uses as well, but I'm not sure of all of them that it uses, otherwise I'd provide a complete list of the versions.
I suspose that I'll just have to stick to using the namespaced sheets or a different processor. For some reason, the newest version of Saxon doesn't like these stylesheets either (although the lines that it is complaining about look fine to me), but I can still use xsltproc with the namespaced ones or lxml with all of them.
I suspect that you are right about where the error is occuring.