public void execute(TransformerImpl transformer) throws TransformerException
  {

    boolean found = false;

    for (ElemTemplateElement childElem = getFirstChildElem();
            childElem != null; childElem = childElem.getNextSiblingElem())
    {
      int type = childElem.getXSLToken();

      if (Constants.ELEMNAME_WHEN == type)
      {
        found = true;

        ElemWhen when = (ElemWhen) childElem;

        // must be xsl:when
        XPathContext xctxt = transformer.getXPathContext();
        int sourceNode = xctxt.getCurrentNode();
        
        // System.err.println("\""+when.getTest().getPatternString()+"\"");
        
        // if(when.getTest().getPatternString().equals("COLLECTION/icuser/ictimezone/LITERAL='GMT +13:00 Pacific/Tongatapu'"))
        // 	System.err.println("Found COLLECTION/icuser/ictimezone/LITERAL");

          if (when.getTest().bool(xctxt, sourceNode, when)) {
              transformer.executeChildTemplates(when, true);

              return;
          }
      }
      else if (Constants.ELEMNAME_OTHERWISE == type)
      {
        found = true;

        // xsl:otherwise
        transformer.executeChildTemplates(childElem, true);

        return;
      }
    }

    if (!found)
      transformer.getMsgMgr().error(
        this, XSLTErrorResources.ER_CHOOSE_REQUIRES_WHEN);
  }
public void execute ( TransformerImpl transformer ) throws TransformerException { boolean found = false ; for ( ElemTemplateElement childElem = getFirstChildElem ( ) ; childElem != null ; childElem = childElem . getNextSiblingElem ( ) ) { int type = childElem . getXSLToken ( ) ; if ( Constants . ELEMNAME_WHEN == type ) { found = true ; ElemWhen when = ( ElemWhen ) childElem ; XPathContext xctxt = transformer . getXPathContext ( ) ; int sourceNode = xctxt . getCurrentNode ( ) ; if ( when . getTest ( ) . bool ( xctxt , sourceNode , when ) ) { transformer . executeChildTemplates ( when , true ) ; return ; } } else if ( Constants . ELEMNAME_OTHERWISE == type ) { found = true ; transformer . executeChildTemplates ( childElem , true ) ; return ; } } if ( ! found ) transformer . getMsgMgr ( ) . error ( this , XSLTErrorResources . ER_CHOOSE_REQUIRES_WHEN ) ; }
Execute the xsl:choose transformation.


@param transformer non-null reference to the the current transform-time state.

@throws TransformerException