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

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


   */
  public void validate(IndexedRegion node) {
    Element target = (Element) node;
    if (CMUtil.isForeign(target))
      return;
    CMElementDeclaration edec = CMUtil.getDeclaration(target);
    if (edec == null)
      return;
    CMNamedNodeMap declarations = edec.getAttributes();

    List modelQueryNodes = null;
    NamedNodeMap attrs = target.getAttributes();
    for (int i = 0; i < attrs.getLength(); i++) {
      int rgnType = REGION_NAME;
View Full Code Here


  private boolean hasUnknownPrefix(Element target) {
    return isUnknownElement(target) && CMUtil.isForeign(target);
  }

  private boolean isUnknownElement(Element target) {
    CMElementDeclaration dec = CMUtil.getDeclaration(target);
    return dec == null;
  }
View Full Code Here

    CMElementDeclaration dec = CMUtil.getDeclaration(target);
    return dec == null;
  }

  private boolean isUnknownAttr(IDOMAttr attr, Element target) {
    CMElementDeclaration dec = CMUtil.getDeclaration(target);
    if (dec == null)
      return true; // unknown.
    CMNamedNodeMap adecls = dec.getAttributes();
    CMAttributeDeclaration adec = (CMAttributeDeclaration) adecls.getNamedItem(attr.getName());
    return adec == null;
  }
View Full Code Here

    }
    return false;
  }

  public boolean isEndTagOmissible(Element element) {
    CMElementDeclaration dec = CMNodeUtil.getElementDeclaration(element);
    if (dec == null || !(dec instanceof HTMLPropertyDeclaration))
      return false;
    int type = ((HTMLPropertyDeclaration)dec ).getOmitType();
    return type == HTMLElementDeclaration.OMIT_BOTH || type == HTMLElementDeclaration.OMIT_END || type == HTMLElementDeclaration.OMIT_END_DEFAULT || type == HTMLElementDeclaration.OMIT_END_MUST;
  }
View Full Code Here

    if (child.getNodeType() == Node.ELEMENT_NODE) {
      if (!impl.isGlobalTag())
        return true; // non HTML tag
      IDOMElement childElement = (IDOMElement) child;

      CMElementDeclaration myDec = CMNodeUtil.getElementDeclaration(element);
      if (myDec == null)
        return true;
      //if (!(myDec instanceof HTMLElementDeclaration)) return true;
      if (myDec.getContentType() == CMElementDeclaration.EMPTY)
        return false;

      if (!childElement.isGlobalTag())
        return true; // non HTML tag
      CMElementDeclaration childDec = CMNodeUtil.getElementDeclaration(childElement);
      if (childDec == null)
        return true;
      //if (!(childDec instanceof HTMLElementDeclaration)) return true;

      if (myDec instanceof HTMLElementDeclaration) {
View Full Code Here

      makeBuddySystem(elements);
      addSSIDecls();
    }

    protected String getKeyName(CMNode original) {
      CMElementDeclaration edecl = getDecl(original);
      if (edecl == null)
        return null;
      return edecl.getElementName();
    }
View Full Code Here

        return null;
      return edecl.getElementName();
    }

    protected CMNode createBuddySystem(CMNode original) {
      CMElementDeclaration edecl = getDecl(original);
      return new CMElementDeclarationBuddySystem(edecl, isXHTML());
    }
View Full Code Here

      if (ssi == null)
        return;
      CMNamedNodeMap elements = ssi.getElements();
      Iterator i = elements.iterator();
      while (i.hasNext()) {
        CMElementDeclaration decl = (CMElementDeclaration) i.next();
        if (decl == null)
          continue;
        put(decl.getElementName(), decl);
      }
    }
View Full Code Here

        if (tagfiles[i].getType() == IResource.FILE) {
          if (tagfiles[i].getType() != IResource.FILE)
            continue;
          String extension = tagfiles[i].getFileExtension();
          if (extension != null && (extension.equals("tag") || extension.equals("tagx"))) {
            CMElementDeclaration ed = createElementDeclaration(document, (IFile) tagfiles[i]);
            if (ed != null) {
              document.fElements.setNamedItem(ed.getNodeName(), ed);
            }
          }
        }
      }
    }
View Full Code Here

      if(nodeName.indexOf(':') > 0) {
        nodeName = nodeName.substring(nodeName.indexOf(':'));
      }
      // tag
      if (nodeName.equals(JSP11TLDNames.TAG)) {
        CMElementDeclaration ed = createElementDeclaration(document, child);
        if (ed != null) {
          document.fElements.setNamedItem(ed.getNodeName(), ed);
        }
      }
      // tag-file
      else if (nodeName.equals(JSP20TLDNames.TAG_FILE) && child.getNodeType() == Node.ELEMENT_NODE && child.hasChildNodes()) {
        Element tagFileElement = (Element) child;
        Node path = tagFileElement.getFirstChild();
        while (path != null) {
          if (path.getNodeType() == Node.ELEMENT_NODE && (JSP20TLDNames.PATH.equals(path.getNodeName()) || JSP20TLDNames.PATH.equals(path.getLocalName()))) {
            String pathValue = getContainedText(path);
            if (pathValue != null && pathValue.length() > 0) {
              CMElementDeclarationImpl ed = (CMElementDeclarationImpl) createElementDeclaration(document, tagFileElement, pathValue);
              if (ed != null) {
                document.fElements.setNamedItem(ed.getNodeName(), ed);
              }
            }
          }
          path = path.getNextSibling();
        }
View Full Code Here

TOP

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

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.