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 348959 - libxslt does not print line number if XPath error: Invalid type
libxslt does not print line number if XPath error: Invalid type
Status: RESOLVED FIXED
Product: libxslt
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2006-07-27 17:33 UTC by Stepan Koltsov
Modified: 2006-08-10 12:05 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Stepan Koltsov 2006-07-27 17:33:39 UTC
After executing xsltproc I get something wrong without printling line number.

===
[yozh@dhcp218-152:~/tmp/x]% xsltproc test.xsl test.xml
XPath error : Invalid type
<html><body>
                begin (won't get end)
                </body></html>
zsh: exit 10    xsltproc test.xsl test.xml
===

xsltproc produces incomplete XML (there is no line "end (you don't see me)" in the output).
xsltproc does not print line number if this is error.

Same things when executing template using API.

File test.xml:

===
<?xml version="1.0" encoding="windows-1251"?>
<?xml-stylesheet type="text/xsl" href="test.xsl"?>
<page
        xmlns:xi="http://www.w3.org/2001/XInclude">
    <xxx>
        <a>
            <b>bbb</b>
        </a>
    </xxx>
</page>
===

test.xsl:

===
<?xml version="1.0" encoding="windows-1251"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1">

    <xsl:template match="/">
        <html>
            <body>
                begin (won't get end)
                <xsl:call-template name="yyy">
                    <xsl:with-param name="content">
                        <xsl:apply-templates select="page/xxx"/>
                    </xsl:with-param>
                </xsl:call-template>
                end (you don't see me)
            </body>
        </html>
    </xsl:template>

    <xsl:template name="yyy">
        <xsl:param name="content"/>
        <xsl:copy-of select="$content"/>
    </xsl:template>

    <xsl:template match="xxx">
        <xsl:param name="bebe"/>
        <input value="{$bebe/xxx}"/>
    </xsl:template>

</xsl:stylesheet>
===

Version:

===
[yozh@dhcp218-152:~/tmp/x]% xsltproc --version                                                                   
Using libxml 20626, libxslt 10117 and libexslt 813
xsltproc was compiled against libxml 20626, libxslt 10117 and libexslt 813
libxslt 10117 was compiled against libxml 20626
libexslt 813 was compiled against libxml 20626
===

With current behaviour it is very hard to find where is error in template.
Comment 1 kbuchcik 2006-08-10 12:05:31 UTC
The error reporting has been enhanced a bit. As least for your
case the line number, the element and a message about what's going on
is reported now.

>xsltproc bug348959.xsl bug348959.xml
XPath error : Invalid type
runtime error: file bug348959.xsl line 23 element input
Internal error: Failed to evaluate the AVT of attribute 'value'.
no result for bug348959.xml

>xsltproc -version
Using libxml 20624CVS2772, libxslt 10115CVS1043 and libexslt 812CVS1043
xsltproc was compiled against libxml 20624, libxslt 10115 and libexslt 812
libxslt 10115 was compiled against libxml 20624
libexslt 812 was compiled against libxml 20624