Class ElemIf

All Implemented Interfaces:
Serializable, SourceLocator, XSLTVisitable, PrefixResolver, ExpressionNode, WhitespaceStrippingElementMatcher, Document, Element, Node, NodeList

public class ElemIf extends ElemTemplateElement
Implement xsl:if.
 invalid input: '<!'ELEMENT xsl:if %template;>
 invalid input: '<!'ATTLIST xsl:if
   test %expr; #REQUIRED
   %space-att;
 >
 
See Also:
  • Constructor Details

    • ElemIf

      public ElemIf()
  • Method Details

    • setTest

      public void setTest(XPath v)
      Set the "test" attribute. The xsl:if element must have a test attribute, which specifies an expression.
      Parameters:
      v - test attribute to set
    • getTest

      public XPath getTest()
      Get the "test" attribute. The xsl:if element must have a test attribute, which specifies an expression.
      Returns:
      the "test" attribute for this element.
    • compose

      public void compose(StylesheetRoot sroot) throws TransformerException
      This function is called after everything else has been recomposed, and allows the template to set remaining values that may be based on some other property that depends on recomposition.
      Overrides:
      compose in class ElemTemplateElement
      Parameters:
      sroot - The root stylesheet.
      Throws:
      TransformerException
    • getXSLToken

      public int getXSLToken()
      Get an int constant identifying the type of element.
      Overrides:
      getXSLToken in class ElemTemplateElement
      Returns:
      The token ID for this element
      See Also:
    • getNodeName

      public String getNodeName()
      Return the node name.
      Specified by:
      getNodeName in interface Node
      Overrides:
      getNodeName in class ElemTemplateElement
      Returns:
      the element's name
    • execute

      public void execute(TransformerImpl transformer) throws TransformerException
      Conditionally execute a sub-template. The expression is evaluated and the resulting object is converted to a boolean as if by a call to the boolean function. If the result is true, then the content template is instantiated; otherwise, nothing is created.
      Overrides:
      execute in class ElemTemplateElement
      Parameters:
      transformer - non-null reference to the the current transform-time state.
      Throws:
      TransformerException