]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
enforce users to call getParser so it can setup the xslt filter
authorKeiron Liddle <keiron@apache.org>
Fri, 19 Apr 2002 08:02:52 +0000 (08:02 +0000)
committerKeiron Liddle <keiron@apache.org>
Fri, 19 Apr 2002 08:02:52 +0000 (08:02 +0000)
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

index 89ba30876a3e8a8edae54ae9ab3afb79d85e91df..cf24a3ea42e87d2c0fca092401ba6f73dbcb28a4 100644 (file)
@@ -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