Interface MathMLSemanticsElement

All Superinterfaces:
Element, MathMLElement, Node
All Known Implementing Classes:
Semantics

public interface MathMLSemanticsElement extends MathMLElement
This interface represents the semantics element in MathML.
  • Method Details

    • getBody

      MathMLElement getBody()
      This attribute represents the first child of the semantics element, i.e. the child giving the primary content represented by the element.
      Returns:
      value of the body attribute.
    • setBody

      void setBody(MathMLElement body)
      setter for the body attribute.
      Parameters:
      body - new value for body.
      See Also:
    • getNAnnotations

      int getNAnnotations()
      Represents the number of annotation or annotation-xml children of the semantics element, i.e. the number of alternate content forms for this element.
      Returns:
      value of the nAnnotations attribute.
    • getAnnotation

      MathMLElement getAnnotation(int index)
      This method gives access to the index-th alternate content associated with a semantics element.
      Parameters:
      index - The one-based index of the annotation being retrieved.
      Returns:
      The MathMLAnnotationElement or MathMLXMLAnnotationElement representing the index-th annotation or annotation-xml child of the semantics element. Note that all child elements of a semantics element other than the first are required to be of one of these types.
    • insertAnnotation

      MathMLElement insertAnnotation(MathMLElement newAnnotation, int index) throws DOMException
      This method inserts newAnnotation before the current index-th alternate content associated with a semantics element. If index is 0, newAnnotation is appended as the last annotation or annotation-xml child of this element.
      Parameters:
      newAnnotation - A MathMLAnnotationElement or MathMLXMLAnnotationElement representing the new annotation or annotation-xml to be inserted.
      index - The position in the list of annotation or annotation-xml children before which newAnnotation is to be inserted. The first annotation is numbered 1.
      Returns:
      The MathMLAnnotationElement or MathMLXMLAnnotationElement child of this element that represents the new annotation in the DOM.
      Throws:
      DOMException - HIERARCHY_REQUEST_ERR: Raised if newAnnotation is not a MathMLAnnotationElement or MathMLXMLAnnotationElement. INDEX_SIZE_ERR: Raised if index is greater than the current number of annotation or annotation-xml children of this semantics element.
    • setAnnotation

      MathMLElement setAnnotation(MathMLElement newAnnotation, int index) throws DOMException
      This method allows setting or replacement of the index-th alternate content associated with a semantics element. If there is already an annotation or annotation-xml element with this index, it is replaced by newAnnotation.
      Parameters:
      newAnnotation - A MathMLAnnotationElement or MathMLXMLAnnotationElement representing the new value of the index-th annotation or annotation-xml child of this semantics element.
      index - The position in the list of annotation or annotation-xml children of this semantics element that is to be occupied by newAnnotation. The first annotation element is numbered 1.
      Returns:
      The MathMLAnnotationElement or MathMLXMLAnnotationElement child of this element that represents the new annotation in the DOM.
      Throws:
      DOMException - HIERARCHY_REQUEST_ERR: Raised if newAnnotation is not a MathMLAnnotationElement or MathMLXMLAnnotationElement. INDEX_SIZE_ERR: Raised if index is greater than one more than the current number of annotation or annotation-xml children of this semantics element.
    • deleteAnnotation

      void deleteAnnotation(int index)
      A convenience method to delete the index-th alternate content associated with this semantics element.
      Parameters:
      index - The one-based index of the annotation being deleted.
    • removeAnnotation

      MathMLElement removeAnnotation(int index)
      A convenience method to delete the index-th alternate content associated with this semantics element, and to return it to the caller.
      Parameters:
      index - The one-based index of the annotation being deleted.
      Returns:
      The MathMLAnnotationElement or MathMLXMLAnnotationElement being deleted.