Re: [xslt] I/O error : Is a directory - error processing a DB book with docbook-xsl chunk stylesheet
- From: Daniel Veillard <veillard redhat com>
- To: Daniel Leidert <daniel leidert spam gmx net>
- Cc: The Gnome XSLT library mailing-list <xslt gnome org>, ml_docbook-apps <docbook-apps lists oasis-open org>
- Subject: Re: [xslt] I/O error : Is a directory - error processing a DB book with docbook-xsl chunk stylesheet
- Date: Thu, 22 Nov 2007 05:10:49 -0500
On Thu, Nov 22, 2007 at 04:55:03AM +0100, Daniel Leidert wrote:
> Am Mittwoch, den 21.11.2007, 18:40 -0500 schrieb Daniel Veillard:
> > On Wed, Nov 21, 2007 at 06:55:20PM +0100, Daniel Leidert wrote:
> > > Hi libxslt authors,
> > >
> > > Some time ago I already reported this issue [1], but it seems I forgot
> > > to examine it further. Today I got a private mail about the same problem
> > > so I decided to find a testcase to debug the problem and I was able to
> > > create a very short example, that fails for me with an I/O.
> > >
> > > Can you please be so kind to take a look at it and verify, if it's a bug
> > > in libxslt? In this case I would open a bug report. Please follow these
> > > steps after saving the attached files:
> > >
> > > mkdir built-doc
> > > xsltproc --output ./built-doc/ book.xsl book.xml
> > >
> > > The result for me is:
> > >
> > > Writing ch01.html for chapter
> > > Writing index.html for book
> > > I/O error : Is a directory
> > > I/O error : Is a directory
> >
> > Can you run with -v to see what it is trying to do at that point.
>
> It seems to close everything and then it throws this error. I uploaded
> the whole output to [1]. If I run it withpout the --output option and
> compare the resultng log to the one, that fails, then I cannot find
> compelling differences except, the last lines that differ:
Thanks for doing the tests.
> > [..]
> > found variable 'generate.manifest'
> > xsltIf: test evaluate to 0
> > Shutting down module : http://icl.com/saxon
> > -I/O error : Is a directory
> > -I/O error : Is a directory
> > freeing transformation dictionary
> > freeing dictionary from stylesheet
> > freeing dictionary from stylesheet
> > freeing dictionary from stylesheet
> > freeing dictionary from stylesheet
> > +HTML DOCUMENT
> > +encoding=UTF-8
> > +standalone=true
> > + DTD(html), PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN, SYSTEM http://www.w3.org/TR/html4/loose.dtd
>
> Not sure if that helps. These last 4 lines (prefixed with the '+' here)
> seem to be the related to the cause of the problem. Is it related to ...
yes to me that confirms my early analysis,
> [..]
> > > The problem seems to be related to the --output option and the doctype-*
> > > attributes of xsl:output, because if you don't use --output option or
> > > remove the doctype-* attributes, then the example does not fail.
> >
> > Maybe the doctype-* attributes force the presence of a DTD node so
> > the main document is not empty and you get the error, that does not
> > sound wrong. What you want to do is set doctypes for the chunks, and
> > that should be done on the exslt:document element and not on the
> > main stylesheet output definition.
>
> ... this comment? To be honest, docbook-xsl sets the encoding and
> doctype values via own parameters, that are then given to the
> exslt:document function. So giving the doctype* attributes via
> xsl:output is not necessary (and normally done via parameters), but also
> not wrong, even for chunked output. But is it a bug, that xsltproc fails
It's not wrong, but it indicates that you want a DTD in the main document
output. Since you have a non-empty main document as a result libxslt needs
to save it, and specifying a directory as the output leads to an error,
which is IMHO clearly labelled as an error in the target type.
> in this case? If not: Should there maybe be a comment (in a LIMITATIONS
> section) in the manpage (and other related documentation) about this
> issue?
I don't think this really can be flagged as a limitation, as libxslt
does what the stylesheet user asked for. The only point that could be
clarified would be that a directory output on the command line is unsuitable
for stylesheet producing a main document (as xsltproc should not try to
guess a name for the output result). The trivial workaround is to give
an output name for a file in that directory, the chunks will go there
and if there happen to be a main output document , it will be saved under
that name.
Seems to me a slight exageration of users expectation in front of
of corner case input given to the processor. Frankly if xsltproc were
not trying to save the main output document, people would complain it's
a bug (rightly IMHO), the use of a directory name is a convenience to
the user, if the user is unable to control the fact that his stylesheet
generates a main document, then get it to save to a file, just use:
xsltproc --output ./built-doc/notneeded.html book.xsl book.xml
rm -f ./built-doc/notneeded.html
and be done with it, if for some reason you ended up with a main document
it won't break your process.
Daniel
--
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard | virtualization library http://libvirt.org/
veillard redhat com | libxml GNOME XML XSLT toolkit http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]