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

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


    if (collection == null)
      return;

    content = new CMGroupImpl(CMGroup.SEQUENCE, 1, 1);
    // summary
    CMNode dec = collection.getNamedItem(HTML50Namespace.ElementName.SUMMARY);
    if (dec != null)
      content.appendChild(dec);

    CMGroupImpl group = new CMGroupImpl(CMGroup.CHOICE, 1, CMContentImpl.UNBOUNDED);
    content.appendChild(group);
View Full Code Here


      return;

    // ( )+
    content = new CMGroupImpl(CMGroup.SEQUENCE, 1, CMContentImpl.UNBOUNDED);
    // OPTION
    CMNode dec = collection.getNamedItem(CHTMLNamespace.ElementName.OPTION);
    if (dec != null)
      content.appendChild(dec);
  }
View Full Code Here

  /*
   * @see ModelQuery#getCMNode(Node)
   */
  public CMNode getCMNode(Node node) {
    CMNode result = super.getCMNode(node);
    if (result == null) {
      ModelQuery query = getEmbeddedModelQuery(node);
      if (query != null) {
        result = query.getCMNode(node);
      }
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

    CMNamedNodeMap prohibited = getProhibitedAncestors(candidate);
    if (prohibited == null)
      return false;
    Element parent = target;
    while (parent != null) {
      CMNode pdec = prohibited.getNamedItem(parent.getNodeName());
      if (pdec != null)
        return true;
      parent = getExplicitParentElement(parent);
    }
    return false;
View Full Code Here

             * later.
             */
            int availableChildCount = availableChildElementDeclarations.size();
            String elementName = ced.getElementName().toLowerCase(Locale.US);
            for (int i = 0; i < availableChildCount; i++) {
              CMNode cmnode = (CMNode) availableChildElementDeclarations.get(i);
              if (cmnode.getNodeType() == CMNode.ELEMENT_DECLARATION && cmnode.getNodeName().toLowerCase(Locale.US).equals(elementName)) {
                return;
              }
            }
           
            error = ErrorState.INVALID_CONTENT_ERROR;
View Full Code Here

  CMGroupImpl createContent(int eid) {
    if (eid == ID_UNKNOWN)
      return null;

    CMGroupImpl content = null;
    CMNode child = null;

    switch (eid) {
      case Ids.ID_INCLUDE :
      case Ids.ID_FORWARD :
        // (jsp:param)*
 
View Full Code Here

  public CMNodeList getChildNodes() {
    if (fChildNodes == null) {
      CMNodeListImpl childNodes = new CMNodeListImpl();
      CMNodeList children = fGroup.getChildNodes();
      for (int i = 0; i < children.getLength(); i++) {
        CMNode child = children.item(i);
        if (child instanceof CMGroup)
          childNodes.appendItem(new CMGroupWrapperImpl(fPrefix, (CMGroup) child));
        else if (child instanceof CMElementDeclaration)
          childNodes.appendItem(new CMElementDeclarationWrapperImpl(fPrefix, (CMElementDeclaration) child));
        else
View Full Code Here

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

  }

  private static void extractDeclarations(Hashtable availables, CMGroup group) {
    CMNodeList content = group.getChildNodes();
    for (int i = 0; i < content.getLength(); i++) {
      CMNode cmn = content.item(i);
      if (cmn == null || cmn.getNodeType() != CMNode.ELEMENT_DECLARATION)
        continue;
      addInclusion(availables, (CMElementDeclaration) cmn);
    }
  }
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.