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 157119 - exsl:document can't create directories
exsl:document can't create directories
Status: RESOLVED OBSOLETE
Product: libxslt
Classification: Platform
Component: general
1.1.9
Other Windows
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2004-11-02 10:02 UTC by Th.-Fischer
Modified: 2021-07-05 11:01 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Th.-Fischer 2004-11-02 10:02:43 UTC
If I use exsl:document('abc/xyz.xml') and
the directory 'abc' not exists in the current
directory, then I get this message:
  I/O error : No such file or directory

<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:exsl="http://exslt.org/common"
  extension-element-prefixes="exsl"
>
  <xsl:template match="/">
    <exsl:document href="abc/xyz.xml">
      <test/>
    </exsl:document>
  </xsl:template>
</xsl:stylesheet>

<!--
  xsltprocexe -V
  Using libxml 20612, libxslt 10109 and libexslt 807
  xsltproc was compiled against libxml 20612, libxslt 10109 and libexslt 807
  libxslt 10109 was compiled against libxml 20612
  libexslt 807 was compiled against libxml 20612
-->
Comment 1 Th.-Fischer 2004-11-29 14:59:10 UTC
Anybody home?
The reported bug concerns also every attempt to create
a directory via command line output parameter. Example:
test.xslt:
==========
   <xsl:stylesheet version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   >
     <xsl:template match="/">hello</xsl:template>
   </xsl:stylesheet>
command line:
=============
   xsltproc -o test/test.txt test.xslt test.xslt

xsltproc -V:
============
   Using libxml 20615CVS2219, libxslt 10112CVS965 and libexslt 810CVS965
   xsltproc was compiled against libxml 20615, libxslt 10112 and libexslt 810
   libxslt 10112 was compiled against libxml 20615
   libexslt 810 was compiled against libxml 20615
Comment 2 Daniel Veillard 2004-11-29 15:07:13 UTC
Works for me !

paphio:~ -> xsltproc -o does_not_exist/res tst.xsl tst.xsl
paphio:~ -> cat does_not_exist/res
<?xml version="1.0"?>
hello
paphio:~ ->

Daniel
Comment 3 Th.-Fischer 2004-11-29 15:17:14 UTC
> paphio:~ ->
         ^
         ^
         Are you sure you use w32 (not cygwin!)   ;o)

(under cygwin it works for me too)
Comment 4 Daniel Veillard 2004-11-29 21:55:49 UTC
ohhh, it's a Windows only bug ! I didn't realize that,

okay, but I can't test it myself, maybe you should post to the list
about that.

Daniel
Comment 5 Andreas Beppler 2005-02-05 15:18:39 UTC
Thomas is right, the same symptoms under "pure" windows for me.

So, what can we do? Which Information is needed?

Thanks for any help!

Andreas

Comment 6 André Klapper 2006-09-29 16:27:03 UTC
Th.-Fischer, andreas: is this still an issue?

daniel: *ping* - can you answer andreas' question how to provide information?

thanks everybody! :-)
Comment 7 Daniel Veillard 2006-09-30 13:46:51 UTC
No idea, I don't have any Windows box around ... can't test, won't fix
myself, but I take patches especially if discussed on the list (since
basically I can't test said patches)

Daniel
Comment 8 Lothar Behrens 2007-09-28 18:14:31 UTC
Hi,

I have the same problem and like to help. Is the bug still open or not currently processed ?

Trying to figure out where the problem is in comparsion to cygwin, I guess it is the difference
between slach and backslash of the URI.

So it would be helpful to hint me where to reqwrite the URI and if there is a function for it which ?

Lothar
Comment 9 Rob Richards 2007-09-28 18:23:07 UTC
Try the latest release. I believe this issue was related to another that was fixed in 2.6.30
Comment 10 Lothar Behrens 2007-09-28 18:50:04 UTC
Did you mean the libxml2 version (2.6.30) ?
Comment 11 Rob Richards 2007-09-28 18:57:43 UTC
Sorry, yes. Also in combination with libxslt 1.1.22. The original bug reported here works fine for me, so see if you still have problems with the latest releases
Comment 12 Lothar Behrens 2007-09-29 11:11:47 UTC
I have copied the xmlIO.c file from 2.6.30 and it had helped with one exception:

I do use Open Watcom compiler (1.3) on my development machine. And therefore I have made
some extentions to be able to compile both, libxml2 and libxslt. This way I tried to copy only
that file I guessed to solve my problem.

The exception is, that there is propably a bug in xmlWrapStatUtf8. I have added some lines
to fall back to native version when compiled under Open Watcom. 

The bug happens due to passing a reference to a struct stat variable to a function handling
with struct wstat. This results into a buffer overrun I think and kills the contents of at least
the path pointer variable.

To make a full bugfix, I think I need to repackage a copy of the contents of the wstat structure into
the stat structure and propably convert WChar strings back to Utf8 and pass the copy to _wstat(),
or anything that has not the same size.

I have another question: Do you like to have the changes I made to compile libxslt with the
Open Watcom compiler (only a DLL version yet) ?

I have made special extentions to get exports of some functions without touching them.

If there is no way to help you adding Open Watcom support, I need to add the code in my vendor
directory on my CVS to track my changes.

Here is the function with bugfix:

static int
xmlWrapStatUtf8(const char *path,struct stat *info)
{
#ifdef __WATCOMC__
	return xmlWrapStatNative(path, info);
#else
#ifdef HAVE_STAT
    int retval = -1;
    wchar_t *wPath;

    wPath = __xmlIOWin32UTF8ToWChar(path);
    if (wPath)
    {
       retval = _wstat(wPath,info);
       xmlFree(wPath);
    }
    /* maybe path in native encoding */
    if(retval < 0)
       retval = stat(path,info);
    return retval;
#else
    return -1;
#endif
#endif //__WATCOMC__
}
Comment 13 Rob Richards 2007-10-01 09:46:30 UTC
A lot of information there :).
First, based on what you are saying, is this bug currently fixed and your issue is just the needed Watcom changes? If so, this bug should be closed.

Secondly, can you send the Watcom related information, issues and suggested changes to the list? Might possibly also get some comments from other Watcom users.
Comment 14 Matěj Cepl 2008-07-06 05:44:50 UTC
Well, running the style sheet in the original comment of this bug with xsltproc (Using libxml 20632, libxslt 10124 and libexslt 813), I get no abc subdirectory of the current directory.
Comment 15 Matěj Cepl 2008-07-06 05:46:03 UTC
And that's on Fedora 9 with libxslt-1.1.24-1.fc9.i386
Comment 16 Matěj Cepl 2008-07-06 05:48:05 UTC
Sorry, nonsense, I forgot to add input file. No, I cannot reproduce the original issue here. This bug should be probably closed.
Comment 17 GNOME Infrastructure Team 2021-07-05 11:01:06 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/libxslt/-/issues/

Thank you for your understanding and your help.