xmlstarlet ignores XML attributes

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

xmlstarlet ignores XML attributes

Kay Ulbrich
Hello,

on a current Cygwin-installation, xmlstarlet fails to validate a valid
XML document against an XML schema (XSD). One gets error messages like

attribute 'date': '' is not a valid value of the atomic type 'xs:dateTime'.

on attributes, which are present. The behaviour can be reproduced using
the example files from the attached tar-archive via:

        xmlstarlet val -e -s minimal.xsd minimal.xml

On the versions installed on Debian Testing, for instance, the
validation works for the same documents.

I found a quite recent similar bug report for Debian, there seems to be
a problem with certain versions of libxml:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=832602

Additional information below.

*Failing on Cygwin:*

$ uname -a
CYGWIN_NT-10.0 goe-nb-ubk-w10 2.9.0(0.318/5/3) 2017-09-12 10:18 x86_64
Cygwin

$ xmlstarlet --version
1.6.1
compiled against libxml2 2.9.1, linked with 20904
compiled against libxslt 1.1.28, linked with 10129

$ ldd `which xmlstarlet.exe`
        ntdll.dll => /cygdrive/c/Windows/SYSTEM32/ntdll.dll (0x7ffbcc5e0000)
        KERNEL32.DLL => /cygdrive/c/Windows/System32/KERNEL32.DLL
(0x7ffbca5f0000)
        KERNELBASE.dll => /cygdrive/c/Windows/System32/KERNELBASE.dll
(0x7ffbc94a0000)
        cygwin1.dll => /usr/bin/cygwin1.dll (0x180040000)
        cygexslt-0.dll => /usr/bin/cygexslt-0.dll (0x3f35d0000)
        cygxml2-2.dll => /usr/bin/cygxml2-2.dll (0x3f3cf0000)
        cygxslt-1.dll => /usr/bin/cygxslt-1.dll (0x3e1240000)
        cyggcrypt-20.dll => /usr/bin/cyggcrypt-20.dll (0x3ee1b0000)
        cygiconv-2.dll => /usr/bin/cygiconv-2.dll (0x3fa9c0000)
        cyglzma-5.dll => /usr/bin/cyglzma-5.dll (0x3f5af0000)
        cygz.dll => /usr/bin/cygz.dll (0x3f3c90000)
        cyggpg-error-0.dll => /usr/bin/cyggpg-error-0.dll (0x3eda70000)
        cygintl-8.dll => /usr/bin/cygintl-8.dll (0x3fa890000)

*Here it worked (Debian Testing):*

$ xmlstarlet --version
1.6.1
compiled against libxml2 2.9.4, linked with 20904
compiled against libxslt 1.1.29, linked with 10129





--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

libxmlbug.txz (942 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

libxml2: Attribute decoding patch (was: Re: xmlstarlet ignores XML attributes)

David Stacey
On 30/09/2017 16:25, Kay Ulbrich wrote:
> on a current Cygwin-installation, xmlstarlet fails to validate a valid
> XML document against an XML schema (XSD).
>
> [snip]
>
> I found a quite recent similar bug report for Debian, there seems to be
> a problem with certain versions of libxml:
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=832602

Yaakov, please could you consider taking the patch attached, which is
from Debian Stretch [1]. Or you may prefer to update to libxml2-2.9.5,
as the patch has been incorporated upstream. Either should address the
problem reported above.

Dave.

[1] - https://packages.debian.org/stretch/libxml2



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

0008-Fix-attribute-decoding-during-XML-schema-validation.patch (3K) Download Attachment