FileDocCategorySizeDatePackage
FuncSubstringBefore.javaAPI DocJava SE 6 API1676Tue Jun 10 00:23:16 BST 2008com.sun.org.apache.xpath.internal.functions

FuncSubstringBefore

public class FuncSubstringBefore extends Function2Args
Execute the SubstringBefore() function.
xsl.usage
advanced

Fields Summary
static final long
serialVersionUID
Constructors Summary
Methods Summary
public com.sun.org.apache.xpath.internal.objects.XObjectexecute(com.sun.org.apache.xpath.internal.XPathContext xctxt)
Execute the function. The function must return a valid object.

param
xctxt The current execution context.
return
A valid XObject.
throws
javax.xml.transform.TransformerException


                            
       
  

    String s1 = m_arg0.execute(xctxt).str();
    String s2 = m_arg1.execute(xctxt).str();
    int index = s1.indexOf(s2);

    return (-1 == index)
           ? XString.EMPTYSTRING : new XString(s1.substring(0, index));