I am using Saxon to transform an XML file to XHTML. I am calling Saxon as a command-line instance through a Perl script.
I am getting the following error:
Validation error
FORG0001: Invalid date “-” (No year after ‘-‘)
Transformation failed: Run-time errors were reported
This error is caused by a non-date passed to an XSLT function that I have written that expects a date. However, I am using this function in many places in my XSLT file and I do not know which instance is causing the problem. I can troubleshoot manually but is it possible to have this transform error also point out what line in the XSLT is causing the issue?
Sorry you didn’t get an answer to this question. Do feel free to use Saxonica’s help lists and support forums, in which case we will always try to help; it’s hit-and-miss whether a question on StackOverflow gets noticed.
Recent releases of Saxon produce an XSLT stack trace which shows the function/template calling stack at the point where a run-time error occurs. It’s not clear why you aren’t seeing this; it might be something to do with the Perl script.
Another diagnostic technique is to use the -T option to produce a full execution trace; the final lines of the trace will tell you what code was being executed at the point of failure.