You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by sa...@apache.org on 2002/05/06 18:21:23 UTC

cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/compiler Parser.java VariableBase.java

santiagopg    02/05/06 09:21:22

  Modified:    java/src/org/apache/xalan/xsltc/compiler Parser.java
                        VariableBase.java
  Log:
  Better error reporting for syntax errors in XPath expressions.
  
  Revision  Changes    Path
  1.41      +4 -6      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Parser.java
  
  Index: Parser.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/Parser.java,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- Parser.java	24 Apr 2002 17:03:15 -0000	1.40
  +++ Parser.java	6 May 2002 16:21:22 -0000	1.41
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: Parser.java,v 1.40 2002/04/24 17:03:15 santiagopg Exp $
  + * @(#)$Id: Parser.java,v 1.41 2002/05/06 16:21:22 santiagopg Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -965,14 +965,12 @@
   	    reportError(ERROR, new ErrorMsg(ErrorMsg.XPATH_PARSER_ERR,
   					    expression, parent));
   	}
  -	catch (ClassCastException e) {
  -	    reportError(ERROR, new ErrorMsg(ErrorMsg.XPATH_PARSER_ERR,
  -					    expression, parent));
  -	}
   	catch (Exception e) {
   	    if (_xsltc.debug()) e.printStackTrace();
  -	    // Intentional fall through
  +	    reportError(ERROR, new ErrorMsg(ErrorMsg.XPATH_PARSER_ERR,
  +					    expression, parent));
   	}
  +
   	// Return a dummy pattern (which is an expression)
   	SyntaxTreeNode.Dummy.setParser(this);
           return SyntaxTreeNode.Dummy; 
  
  
  
  1.15      +5 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/VariableBase.java
  
  Index: VariableBase.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/VariableBase.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- VariableBase.java	26 Apr 2002 18:09:49 -0000	1.14
  +++ VariableBase.java	6 May 2002 16:21:22 -0000	1.15
  @@ -1,5 +1,5 @@
   /*
  - * @(#)$Id: VariableBase.java,v 1.14 2002/04/26 18:09:49 santiagopg Exp $
  + * @(#)$Id: VariableBase.java,v 1.15 2002/05/06 16:21:22 santiagopg Exp $
    *
    * The Apache Software License, Version 1.1
    *
  @@ -264,6 +264,10 @@
   	select = getAttribute("select");
   	if (select.length() > 0) {
   	    _select = getParser().parseExpression(this, "select", null);
  +	    if (_select.isDummy()) {
  +		reportError(this, parser, ErrorMsg.REQUIRED_ATTR_ERR, "select");
  +		return;
  +	    }
   	}
   
   	// Children must be parsed first -> static scoping
  
  
  

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