Project

Profile

Help

Revision 5419d7f2

Added by Michael Kay over 1 year ago

Fix bug #4522

View differences:

latest10/hej/net/sf/saxon/style/XSLTemplate.java
794 794
            jitCompilationDone = true;
795 795
            compilation.setPreScan(false);
796 796
            processAllAttributes();
797

  
798
            if (compilation.getErrorCount() > 0) {
799
                XPathException e = new XPathException("Errors were reported during stylesheet compilation");
800
                e.setHasBeenReported(true); // only intended as an exception message, not something to report to ErrorListener
801
                throw e;
802
            }
803

  
797
            checkForJitCompilationErrors(compilation);
804 798
            validateSubtree(decl, false);
805

  
806
            if (compilation.getErrorCount() > 0) {
807
                XPathException e = new XPathException("Errors were reported during stylesheet compilation");
808
                e.setHasBeenReported(true); // only intended as an exception message, not something to report to ErrorListener
809
                throw e;
810
            }
811

  
799
            checkForJitCompilationErrors(compilation);
812 800
            compileDeclaration(compilation, decl);
813
            // xslTemplate.optimize(decl);
814
            //allocateBindingSlots();
815
            if (compilation.getErrorCount() > 0) {
816
                XPathException e = new XPathException("Errors were reported during stylesheet compilation");
817
                e.setHasBeenReported(true); // only intended as an exception message, not something to report to ErrorListener
818
                throw e;
819
            }
801
            checkForJitCompilationErrors(compilation);
820 802
        }
821 803

  
822 804
    }
823 805

  
806
    private void checkForJitCompilationErrors(Compilation compilation) throws XPathException {
807
        if (compilation.getErrorCount() > 0) {
808
            XPathException e = new XPathException("Errors were reported during JIT compilation of template rule with match=\"" + matchAtt + "\"",
809
                                                  SaxonErrorCode.SXST0001, this);
810
            e.setHasBeenReported(true); // only intended as an exception message, not something to report to ErrorListener
811
            throw e;
812
        }
813
    }
814

  
824 815

  
825 816
    /**
826 817
     * Registers the template rule with each Mode that it belongs to.
latest10/hej/net/sf/saxon/trans/SaxonErrorCode.java
245 245

  
246 246
    public static final String SXRD0004 = "SXRD0004";
247 247

  
248
    /**
249
     * SXST0001: Static error in template rule, found during JIT compilation
250
     */
251

  
252
    public static final String SXST0001 = "SXST0001";
253

  
248 254
    /**
249 255
     * SXST0060: Template in a streaming mode is not streamable
250 256
     */

Also available in: Unified diff