xalan-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkess...@apache.org
Subject cvs commit: xml-xalan/java/src/org/apache/xpath/parser SimpleNode.java
Date Thu, 15 Aug 2002 21:07:45 GMT
jkesselm    2002/08/15 14:07:45

  Modified:    java/src/org/apache/xpath/functions Tag: xslt20
                        FuncNodeKind.java
               java/src/org/apache/xpath/parser Tag: xslt20 SimpleNode.java
  Added:       java/src/org/apache/xpath/functions Tag: xslt20
                        FuncBaseURI.java
  Log:
  xf:base-uri()
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.2   +13 -3     xml-xalan/java/src/org/apache/xpath/functions/Attic/FuncNodeKind.java
  
  Index: FuncNodeKind.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/functions/Attic/FuncNodeKind.java,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- FuncNodeKind.java	15 Aug 2002 19:27:21 -0000	1.1.2.1
  +++ FuncNodeKind.java	15 Aug 2002 21:07:44 -0000	1.1.2.2
  @@ -69,10 +69,16 @@
   import org.apache.xpath.XPath;
   import org.apache.xpath.objects.XObject;
   import org.apache.xpath.objects.XString;
  +import org.apache.xpath.objects.XSequence;
   
   /**
  - * Execute the xf:node-kind function.
    * <meta name="usage" content="advanced"/>
  + * Execute the xf:node-kind function, returning a string. 
  + * 
  + * %OPT% Would it be better to create a single stored instance of
  + * each of the possible XStrings? More resources burned during 
  + * initialization, fewer during execution... but this is a rarely
  + * used function.
    */
   public class FuncNodeKind extends FunctionDef1Arg
   {
  @@ -80,7 +86,8 @@
      * Execute the function.  The function must return
      * a valid object.
      * @param xctxt The current execution context.
  -   * @return A valid XObject.
  +   * @return An XString containing the node kind name, or
  +   * XObject.EMPTY if the input wasn't one of the acceptable values.
      *
      * @throws javax.xml.transform.TransformerException
      */
  @@ -125,6 +132,9 @@
   	// unless the parameter is a Node. But it's unclear whether we
   	// should throw a runtime exception or return something else
   	// in that case.
  -	return (s==null) ? XString.EMPTYSTRING : new XString(s);
  +	if(s==null)
  +		return XSequence.EMPTY; 
  +	else		
  +		return new XString(s);
     }
   }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1   +118 -0    xml-xalan/java/src/org/apache/xpath/functions/Attic/FuncBaseURI.java
  
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.1.2.2 +3 -0      xml-xalan/java/src/org/apache/xpath/parser/Attic/SimpleNode.java
  
  Index: SimpleNode.java
  ===================================================================
  RCS file: /home/cvs/xml-xalan/java/src/org/apache/xpath/parser/Attic/SimpleNode.java,v
  retrieving revision 1.1.2.1.2.1
  retrieving revision 1.1.2.1.2.2
  diff -u -r1.1.2.1.2.1 -r1.1.2.1.2.2
  --- SimpleNode.java	15 Aug 2002 19:27:21 -0000	1.1.2.1.2.1
  +++ SimpleNode.java	15 Aug 2002 21:07:45 -0000	1.1.2.1.2.2
  @@ -317,6 +317,9 @@
   m_builtInFunctions.put(
         new QName("node-kind"),
         new FuncNodeKind());
  +m_builtInFunctions.put(
  +      new QName("base-uri"),
  +      new FuncBaseURI());
     }
   
     /**
  
  
  

---------------------------------------------------------------------
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