Project

Profile

Help

Support #6642

closed

Is there a faster way to compile an XSLT Stylesheet? I'm only interested in errors, I won't run the transformation

Added by Gerben Abbink 18 days ago. Updated 14 days ago.

Status:
Resolved
Priority:
Low
Assignee:
-
Category:
-
Sprint/Milestone:
-
Start date:
2025-01-12
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

I have two (demo) stylesheets of about the same size. Saxonica.xsl and Saxonica-with-error.xsl. Both files are almost the same: Saxonica.xsl has no errors, Saxonica-with-error.xsl has a single XPath error at the end of the file.

If I compile Saxonica.xsl using S9Api XsltCompiler, it takes 6 seconds to compile. If I compile Saxonica-with-error.xsl it takes only 2 seconds to compile (4 seconds faster).

In my application I need to compile and display XSLT errors as fast as possible. I don't actually have to run the transformation; I only need to display possible errors.

I can imagine that the compiler has to do a lot of things, besides error checking when compiling an XSLT stylesheet. But is there a way to tell the compiler I'm not interested in "these other things".

I know there's a function setFastCompilation(), but if true XPath errors are not detected. That's not what I need.


Files

Saxonica.xsl (41.2 MB) Saxonica.xsl Gerben Abbink, 2025-01-12 18:49
Saxonica-with-error.xsl (41.2 MB) Saxonica-with-error.xsl Gerben Abbink, 2025-01-12 18:49

Please register to edit this issue

Also available in: Atom PDF