Package org.eclipse.wst.xml.core.internal.contentmodel

Examples of org.eclipse.wst.xml.core.internal.contentmodel.CMNode


      return exclusion; // already created.
    if (elementCollection == null)
      return null;

    exclusion = new CMGroupImpl(CMGroup.CHOICE, 1, 1);
    CMNode label = elementCollection.getNamedItem(HTML40Namespace.ElementName.NOFRAMES);
    if (label != null)
      exclusion.appendChild(label);

    return exclusion;
  }
View Full Code Here


      createAttributeDeclarations();
      if (attributes == null)
        return null; // fail to create
    }

    CMNode cmnode = attributes.getNamedItem(attrName);
    if (cmnode == null) {
      return null;
    }
    else {
      return (HTMLAttributeDeclaration) cmnode; // already exists.
View Full Code Here

    if (inlines == null)
      return;
    collection.getInline(inlines);
    content.appendChild(inlines);
    // P
    CMNode p = collection.getNamedItem(CHTMLNamespace.ElementName.P);
    if (p != null)
      content.appendChild(p);
  }
View Full Code Here

  protected void makeBuddySystem(CMNamedNodeMap original) {
    Iterator i = original.iterator();
    if (i == null)
      return;
    while (i.hasNext()) {
      CMNode org = (CMNode) i.next();
      String key = getKeyName(org);
      CMNode newNode = createBuddySystem(org);
      put(key, newNode);
    }
  }
View Full Code Here

  /**
   * Actually creates HTMLElementDeclaration instance.
   * @return HTMLElementDeclaration
   */
  protected CMNode create(String elementName) {
    CMNode edec = null;

    if (elementName.equalsIgnoreCase(ACRONYM)) {
      edec = new HedPhrase(ACRONYM, this);
      ((HTMLElemDeclImpl) edec).obsolete(true);
    }
View Full Code Here

  public void getFlow(CMGroupImpl group) {
    if (group == null)
      return;
    super.getFlow(group);
    getSectioning(group);
    CMNode node = getNamedItem(DETAILS);
    if (node != null) {
      group.appendChild(node);
    }
  }
View Full Code Here

            return true;
        return isSameDeclaration((CMElementDeclaration) content, target);
      case CMNode.GROUP :
        CMNodeList children = ((CMGroup) content).getChildNodes();
        for (int i = 0; i < children.getLength(); i++) {
          CMNode child = children.item(i);
          switch (child.getNodeType()) {
            case CMNode.ELEMENT_DECLARATION :
              if (isWholeTagOmissible((CMElementDeclaration) child))
                if (isChild(((CMElementDeclaration) child).getContent(), target))
                  return true;
              if (isSameDeclaration((CMElementDeclaration) child, target))
View Full Code Here

    if (prohibited.getLength() <= 0)
      return; // no prohibited ancestors.

    Element parent = SMUtil.getParentElement(target);
    while (parent != null) {
      CMNode pdec = prohibited.getNamedItem(parent.getNodeName());
      if (pdec != null) { // prohibited element is found in ancestors.
        Segment errorSeg = FMUtil.getSegment((IDOMNode) node, FMUtil.SEG_START_TAG);
        if (errorSeg != null)
          reporter.report(new ErrorInfoImpl(ErrorState.INVALID_CONTENT_ERROR, errorSeg, target));
        break; // If one prohibited ancestor is found, it's enough.
View Full Code Here

    if (misc == null)
      return;
    String[] names = {HTML40Namespace.ElementName.SCRIPT, HTML40Namespace.ElementName.STYLE, HTML40Namespace.ElementName.META, HTML40Namespace.ElementName.LINK, HTML40Namespace.ElementName.OBJECT, HTML40Namespace.ElementName.ISINDEX};
    collection.getDeclarations(misc, Arrays.asList(names).iterator());
    // 2nd, get a title
    CMNode title = collection.getNamedItem(HTML40Namespace.ElementName.TITLE);
    // 3rd, get a base
    CMNode base = collection.getNamedItem(HTML40Namespace.ElementName.BASE);
    if (title == null || base == null)
      return;

    // Top level content is a sequence of %head.misc; and A.
    // 0: (%head.misc;, A)
View Full Code Here

   *            int
   */
  public CMNode item(int index) {
    Iterator iter = iterator();
    while (iter.hasNext()) {
      CMNode node = (CMNode) iter.next();
      if (--index < 0)
        return node;
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.wst.xml.core.internal.contentmodel.CMNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.