You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xalan.apache.org by mk...@apache.org on 2003/10/16 17:04:50 UTC

cvs commit: xml-xalan/java/src/org/apache/xalan/extensions ExpressionVisitor.java

mkwan       2003/10/16 08:04:50

  Modified:    java/src/org/apache/xalan/extensions ExpressionVisitor.java
  Log:
  Apply the patch for bugzilla 14149 from Joanne Tong (joannet@ca.ibm.com).
  
  Revision  Changes    Path
  1.5       +15 -3     xml-xalan/java/src/org/apache/xalan/extensions/ExpressionVisitor.java
  
  Index: ExpressionVisitor.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xalan/extensions/ExpressionVisitor.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- ExpressionVisitor.java	30 Jan 2003 18:45:41 -0000	1.4
  +++ ExpressionVisitor.java	16 Oct 2003 15:04:49 -0000	1.5
  @@ -60,6 +60,7 @@
   import org.apache.xpath.ExpressionOwner;
   import org.apache.xpath.XPathVisitor;
   import org.apache.xpath.functions.FuncExtFunction;
  +import org.apache.xpath.functions.FuncExtFunctionAvailable;
   import org.apache.xpath.functions.Function;
   
   /**
  @@ -95,12 +96,23 @@
      * @return true to continue the visit in the subtree, if any.
      */
     public boolean visitFunction(ExpressionOwner owner, Function func)
  -	{
  +  {
       if (func instanceof FuncExtFunction)
       {
         String namespace = ((FuncExtFunction)func).getNamespace();
         m_sroot.getExtensionNamespacesManager().registerExtension(namespace);      
       }
  -		return true;
  -	}
  +    else if (func instanceof FuncExtFunctionAvailable)
  +    {
  +      String arg = ((FuncExtFunctionAvailable)func).getArg0().toString();
  +      if (arg.indexOf(":") > 0)
  +      {
  +      	String prefix = arg.substring(0,arg.indexOf(":"));
  +      	String namespace = this.m_sroot.getNamespaceForPrefix(prefix);
  +      	m_sroot.getExtensionNamespacesManager().registerExtension(namespace);
  +      }
  +    }
  +    return true;
  +  }
  +
   }
  
  
  

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