Code example for TransformerException

0
 
    // Verify that result has not already been set by another result 
    // element. Recursion is allowed: intermediate results are cleared  
    // in the owner ElemExsltFunction execute(). 
    if (transformer.currentFuncResultSeen()) { 
        throw new TransformerException("An EXSLT function cannot set more than one result!"); 
    } 
 
    int sourceNode = context.getCurrentNode(); 
 
    // Set the return value; 
    XObject var = getValue(transformer, sourceNode); 
    transformer.popCurrentFuncResult(); 
    transformer.pushCurrentFuncResult(var); 
  } 
 
  /** 
   * Get an integer representation of the element type. 
   * 
   * @return An integer representation of the element, defined in the 
   *     Constants class.