FileDocCategorySizeDatePackage
FuncNormalizeSpace.javaAPI DocJava SE 5 API2543Fri Aug 26 14:56:08 BST 2005com.sun.org.apache.xpath.internal.functions

FuncNormalizeSpace

public class FuncNormalizeSpace extends FunctionDef1Arg
Execute the normalize-space() function.
xsl.usage
advanced

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

    XMLString s1 = getArg0AsString(xctxt);

    return (XString)s1.fixWhiteSpace(true, true, false);
  
public voidexecuteCharsToContentHandler(com.sun.org.apache.xpath.internal.XPathContext xctxt, org.xml.sax.ContentHandler handler)
Execute an expression in the XPath runtime context, and return the result of the expression.

param
xctxt The XPath runtime context.
return
The result of the expression in the form of a XObject.
throws
javax.xml.transform.TransformerException if a runtime exception occurs.

    if(Arg0IsNodesetExpr())
    {
      int node = getArg0AsNode(xctxt);
      if(DTM.NULL != node)
      {
        DTM dtm = xctxt.getDTM(node);
        dtm.dispatchCharactersEvents(node, handler, true);
      }
    }
    else
    {
      XObject obj = execute(xctxt);
      obj.dispatchCharactersEvents(handler);
    }