You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by tm...@apache.org on 2002/06/15 17:33:49 UTC

cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/trax TransformerFactoryImpl.java

tmiller     2002/06/15 08:33:49

  Modified:    java/src/org/apache/xalan/xsltc/trax Tag:
                        jaxp-ri-1_2_0-fcs-branch
                        TransformerFactoryImpl.java
  Log:
  fixed bug that passes warnings to listeneer
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.33.8.2  +25 -20    xml-xalan/java/src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java
  
  Index: TransformerFactoryImpl.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/trax/TransformerFactoryImpl.java,v
  retrieving revision 1.33.8.1
  retrieving revision 1.33.8.2
  diff -u -r1.33.8.1 -r1.33.8.2
  --- TransformerFactoryImpl.java	3 Apr 2002 19:26:50 -0000	1.33.8.1
  +++ TransformerFactoryImpl.java	15 Jun 2002 15:33:49 -0000	1.33.8.2
  @@ -363,22 +363,20 @@
       /**
        * Pass warning messages from the compiler to the error listener
        */
  -    private void passWarningsToListener(Vector messages) {
  -	try {
  -	    // Nothing to do if there is no registered error listener
  -	    if (_errorListener == null) return;
  -	    // Nothing to do if there are not warning messages
  -	    if (messages == null) return;
  -	    // Pass messages to listener, one by one
  -	    final int count = messages.size();
  -	    for (int pos=0; pos<count; pos++) {
  -		String message = messages.elementAt(pos).toString();
  -		_errorListener.warning(new TransformerException(message));
  -	    }
  -	}
  -	catch (TransformerException e) {
  -	    // nada
  +    private void passWarningsToListener(Vector messages)  
  +	throws TransformerException
  +    {
  +	if (_errorListener == null || messages == null ) {
  +	    return;
  +	}
  +	// Pass messages to listener, one by one
  +	final int count = messages.size();
  +	for (int pos = 0; pos < count; pos++) {
  +	    String message = messages.elementAt(pos).toString();
  +	    _errorListener.error(
  +		new TransformerConfigurationException(message));
   	}
  +
       }
   
       /**
  @@ -474,7 +472,6 @@
        */
       public Templates newTemplates(Source source)
   	throws TransformerConfigurationException {
  -
   	// Create and initialize a stylesheet compiler
   	final XSLTC xsltc = new XSLTC();
   	if (_debug) xsltc.setDebug(true);
  @@ -499,10 +496,18 @@
   	final String transletName = xsltc.getClassName();
   
   	// Pass compiler warnings to the error listener
  -	if (_errorListener != null)
  -	    passWarningsToListener(xsltc.getWarnings());
  -	else
  +	if (_errorListener != this){  
  +	    //passWarningsToListener(xsltc.getWarnings());
  +	   try {
  +		passWarningsToListener(xsltc.getWarnings());
  +	    }
  +	    catch (TransformerException e) {
  +		throw new TransformerConfigurationException(e);
  +	    }
  +	} 
  +	else {
   	    xsltc.printWarnings();
  +	}
   
   	// Check that the transformation went well before returning
   	if (bytecodes == null) {
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-cvs-help@xml.apache.org