/**
   * Add a child to the child list. <!ELEMENT xsl:attribute-set (xsl:attribute)*> <!ATTLIST
   * xsl:attribute-set name %qname; #REQUIRED use-attribute-sets %qnames; #IMPLIED >
   *
   * @param newChild Child to be added to this node's list of children
   * @return The child that was just added to the list of children
   * @throws DOMException
   */
  public ElemTemplateElement appendChildElem(ElemTemplateElement newChild) {

    int type = ((ElemTemplateElement) newChild).getXSLToken();

    switch (type) {
      case Constants.ELEMNAME_ATTRIBUTE:
        break;
      default:
        error(
            XSLTErrorResources.ER_CANNOT_ADD,
            new Object[] {
              newChild.getNodeName(), this.getNodeName()
            }); // "Can not add " +((ElemTemplateElement)newChild).m_elemName +

        // " to " + this.m_elemName);
    }

    return super.appendChild(newChild);
  }
Beispiel #2
0
  /**
   * Add a child to the child list.
   *
   * @param newChild Child to add to this node's child list
   * @return Child that was just added to child list
   * @throws DOMException
   */
  public ElemTemplateElement appendChild(ElemTemplateElement newChild) {

    int type = ((ElemTemplateElement) newChild).getXSLToken();

    switch (type) {

        // char-instructions
      case Constants.ELEMNAME_TEXTLITERALRESULT:
      case Constants.ELEMNAME_APPLY_TEMPLATES:
      case Constants.ELEMNAME_APPLY_IMPORTS:
      case Constants.ELEMNAME_CALLTEMPLATE:
      case Constants.ELEMNAME_FOREACH:
      case Constants.ELEMNAME_VALUEOF:
      case Constants.ELEMNAME_COPY_OF:
      case Constants.ELEMNAME_NUMBER:
      case Constants.ELEMNAME_CHOOSE:
      case Constants.ELEMNAME_IF:
      case Constants.ELEMNAME_TEXT:
      case Constants.ELEMNAME_COPY:
      case Constants.ELEMNAME_VARIABLE:
      case Constants.ELEMNAME_MESSAGE:

        // instructions
        // case Constants.ELEMNAME_PI:
        // case Constants.ELEMNAME_COMMENT:
        // case Constants.ELEMNAME_ELEMENT:
        // case Constants.ELEMNAME_ATTRIBUTE:
        break;
      default:
        error(
            XSLTErrorResources.ER_CANNOT_ADD,
            new Object[] {
              newChild.getNodeName(), this.getNodeName()
            }); // "Can not add " +((ElemTemplateElement)newChild).m_elemName +

        // " to " + this.m_elemName);
    }

    return super.appendChild(newChild);
  }