xalan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From santiag...@apache.org
Subject cvs commit: xml-xalan/java/src/org/apache/xalan/xsltc/compiler ElementAvailableCall.java FunctionAvailableCall.java
Date Fri, 28 Jun 2002 19:58:55 GMT
santiagopg    2002/06/28 12:58:55

  Modified:    java/src/org/apache/xalan/xsltc/compiler
                        ElementAvailableCall.java
                        FunctionAvailableCall.java
  Log:
  Better error reporting when argument is not a literal.
  
  Revision  Changes    Path
  1.7       +13 -6     xml-xalan/java/src/org/apache/xalan/xsltc/compiler/ElementAvailableCall.java
  
  Index: ElementAvailableCall.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/ElementAvailableCall.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ElementAvailableCall.java	26 Jun 2002 21:25:35 -0000	1.6
  +++ ElementAvailableCall.java	28 Jun 2002 19:58:54 -0000	1.7
  @@ -100,11 +100,18 @@
        * Returns the result that this function will return
        */
       public boolean getResult() {
  -	final LiteralExpr arg = (LiteralExpr) argument();
  -	final String qname = arg.getValue();
  -	final int index = qname.indexOf(':');
  -	final String localName = (index > 0) ? qname.substring(index + 1) : qname;
  -	return getParser().elementSupported(arg.getNamespace(), localName);
  +	try {
  +	    final LiteralExpr arg = (LiteralExpr) argument();
  +	    final String qname = arg.getValue();
  +	    final int index = qname.indexOf(':');
  +	    final String localName = (index > 0) ? 
  +		qname.substring(index + 1) : qname;
  +	    return getParser().elementSupported(arg.getNamespace(), 
  +					        localName);
  +	}
  +	catch (ClassCastException e) {
  +	    return false;
  +	}
       }
   
       /**
  
  
  
  1.10      +5 -1      xml-xalan/java/src/org/apache/xalan/xsltc/compiler/FunctionAvailableCall.java
  
  Index: FunctionAvailableCall.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/xsltc/compiler/FunctionAvailableCall.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- FunctionAvailableCall.java	26 Jun 2002 21:25:35 -0000	1.9
  +++ FunctionAvailableCall.java	28 Jun 2002 19:58:54 -0000	1.10
  @@ -235,6 +235,10 @@
        * xslt function 'function-available' was found.
        */
       public boolean getResult() {
  +	if (_nameOfFunct == null) { 
  +	    return false;
  +	}
  +
           if (_namespaceOfFunct == null ||
               _namespaceOfFunct.equals(EMPTYSTRING) ||
   	    _namespaceOfFunct.equals(TRANSLET_URI))
  
  
  

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


Mime
View raw message