From 80c56fbdab2293a7d9d072e5fdf883507e041914 Mon Sep 17 00:00:00 2001 From: Keiron Liddle Date: Fri, 19 Apr 2002 08:02:52 +0000 Subject: [PATCH] enforce users to call getParser so it can setup the xslt filter git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194736 13f79535-47bb-0310-9956-ffa450edef68 --- src/org/apache/fop/apps/XSLTInputHandler.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/org/apache/fop/apps/XSLTInputHandler.java b/src/org/apache/fop/apps/XSLTInputHandler.java index 89ba30876..cf24a3ea4 100644 --- a/src/org/apache/fop/apps/XSLTInputHandler.java +++ b/src/org/apache/fop/apps/XSLTInputHandler.java @@ -33,6 +33,7 @@ public class XSLTInputHandler extends InputHandler { File xmlfile, xsltfile; boolean useOldTransform = false; + boolean gotParser = false; public XSLTInputHandler(File xmlfile, File xsltfile) { this.xmlfile = xmlfile; @@ -43,6 +44,9 @@ public class XSLTInputHandler extends InputHandler { * overwrites the method of the super class to return the xmlfile */ public InputSource getInputSource() { + if(!gotParser) { + throw new IllegalStateException("The method getParser() must be called and the parser used when using XSLTInputHandler"); + } if (useOldTransform) { try { java.io.Writer writer; @@ -88,6 +92,8 @@ public class XSLTInputHandler extends InputHandler { * */ public XMLReader getParser() throws FOPException { + gotParser = true; + XMLReader result = null; try { // try trax first -- 2.39.5