mmidy       00/12/14 14:45:43

  Modified:    java/src/org/apache/xalan/processor
                        TransformerFactoryImpl.java
               java/src/org/apache/xalan/res XSLTErrorResources.java
  Log:
  Catch and flag an empty DOMSource input error
  
  Revision  Changes    Path
  1.15      +9 -1      
xml-xalan/java/src/org/apache/xalan/processor/TransformerFactoryImpl.java
  
  Index: TransformerFactoryImpl.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/processor/TransformerFactoryImpl.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- TransformerFactoryImpl.java       2000/12/07 17:49:42     1.14
  +++ TransformerFactoryImpl.java       2000/12/14 22:45:42     1.15
  @@ -73,6 +73,8 @@
   import org.apache.xml.utils.DefaultErrorHandler;
   import org.apache.xalan.transformer.TransformerImpl;
   import org.apache.xalan.transformer.TrAXFilter;
  +import org.apache.xalan.res.XSLMessages;
  +import org.apache.xalan.res.XSLTErrorResources;
   
   import javax.xml.transform.Transformer;
   import javax.xml.transform.TransformerFactory;
  @@ -670,7 +672,13 @@
         DOMSource dsource = (DOMSource) source;
         Node node = dsource.getNode();
   
  -      return processFromNode(node, baseID);
  +      if (null != node)
  +        return processFromNode(node, baseID);
  +      else
  +      {
  +        String messageStr = 
XSLMessages.createMessage(XSLTErrorResources.ER_ILLEGAL_DOMSOURCE_INPUT, null);
  +        throw new IllegalArgumentException(messageStr);
  +      }        
       }
   
       try
  
  
  
  1.12      +11 -1     
xml-xalan/java/src/org/apache/xalan/res/XSLTErrorResources.java
  
  Index: XSLTErrorResources.java
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/java/src/org/apache/xalan/res/XSLTErrorResources.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- XSLTErrorResources.java   2000/11/30 09:57:31     1.11
  +++ XSLTErrorResources.java   2000/12/14 22:45:42     1.12
  @@ -86,7 +86,7 @@
     public static final String WARNING_SUFFIX = "WR";
   
     /** Maximum error messages, this is needed to keep track of the number of 
messages.    */
  -  public static final int MAX_CODE = 107;          
  +  public static final int MAX_CODE = 108;          
   
     /** Maximum warnings, this is needed to keep track of the number of 
warnings.          */
     public static final int MAX_WARNING = 26;
  @@ -1074,6 +1074,16 @@
       contents[ER_REFERENCING_ITSELF][1] =
         "Variable {0} is directly or indirectly referencing itself!";
     }
  +  
  +  /** Illegal DOMSource input          */
  +  public static final int ER_ILLEGAL_DOMSOURCE_INPUT = 108;
  +
  +  static
  +  {
  +    contents[ER_ILLEGAL_DOMSOURCE_INPUT][1] =
  +      "The input node can not be null for a DOMSource for newTemplates!";
  +  }
  +  
   
     // Warnings...
   
  
  
  

Reply via email to