RE: [xslt] Incomplete error message "Error Invalid type"

I think this would definitively be worth the pain. My main reason for
switching from Cerces to libxslt was that libxslt was not only fast and
robust, but produced error messages which are really helpful for
debugging - which is unfortunately an issue for XSLT templates... So I
would really appreciate that.

-----Original Message-----
From: Daniel Veillard [] 
Sent: Montag, 10. Juni 2002 14:55
Subject: Re: [xslt] Incomplete error message "Error Invalid type"

On Mon, Jun 10, 2002 at 10:58:50AM +0200, Thomas Mauch wrote:
> Hello,
> when I tried to work with a result tree without using the node-set 
> function, I noticed that in some circustances an incomplete error 
> message is created which does not indicate where the error happened, 
> but just the message text "Error Invalid type". Please have a look the

> attached code snipped. When the now commented value-of call is 
> executed, a "good" error message is created:
> Error Invalid type
> runtime error: file node-set-error.xslt line 16 element value-of
> xsltValueOf: text copy failed
> On the other hand, if the value-of is executed within the for-each 
> loop as it is shown in the code, an incomplete error message just 
> saying
> Error Invalid type
> is created. This makes debugging quite hard.

  Hum, the difference comes from the layer of evaluation. In the first
case the error shows up in the XPath engine (part of libxml2) which has
no or very little contectual informations while in the second case the
errors is caught at the XSLT level which has all the context like the
stylesheets, original docs, and pointers to the instruction locations
toprovide a complete debug informations. The solution would be to either
provide the XPath engine with more compete informations or redirect the
XPath errors back to the XSLT engine for proper display. Either need
some interface extensions at least :-\


Daniel Veillard      | Red Hat Network  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine _______________________________________________
xslt mailing list, project page

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]