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

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


  public void debugPrint(Collection collection)
  {               
    for (Iterator iter = collection.iterator(); iter.hasNext(); )
    {
      CMDocument cmDocument = (CMDocument)iter.next();
      System.out.println("-----------------------------------------------"); //$NON-NLS-1$
      System.out.println("cmDocument (" + cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI") +")")//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
      CMNamedNodeMapImpl elementMap = (CMNamedNodeMapImpl)cmDocument.getElements();
      int size = elementMap.getLength();
      for (int i = 0; i < size; i++)
      {
        CMElementDeclaration ed = (CMElementDeclaration)elementMap.item(i);
        CMDescriptionBuilder builder = new CMDescriptionBuilder();
View Full Code Here


    return jcmdoc;
  }
 
  private CMDocument getDefaultTapestryCMDocument() {
    CMDocument jcmdoc = JSPCMDocumentFactory.getTapestryCMDocument();
    return jcmdoc;
  }
View Full Code Here

  /**
   * Returns the CMDocument that corresponds to the DOM Node. or null if no
   * CMDocument is appropriate for the DOM Node.
   */
  public CMDocument getCorrespondingCMDocument(Node node) {
    CMDocument tagdoc = HTMLCMDocumentFactory.getCMDocument(CMDocType.TAG20_DOC_TYPE);

    CMDocument result = null;
    try {
      if (node.getNodeType() == Node.ELEMENT_NODE) {
        String elementName = node.getNodeName();

        // test to see if this node belongs to JSP's CMDocument (case
View Full Code Here

  }
 
  public CMElementDeclaration getCMElementDeclaration(Element element)
  {
    CMElementDeclaration result = null;
    CMDocument cmDocument = getCorrespondingCMDocument(element);
    if (cmDocument != null)
    {       
      result = (CMElementDeclaration)cmDocument.getElements().getNamedItem(element.getNodeName());   
    }
    return result;
  }
View Full Code Here

  }
 
  private String getNamespace(CMNode cmNode)
  {
    String namespace = null;
    CMDocument cmDocument = (CMDocument)cmNode.getProperty("CMDocument"); //$NON-NLS-1$
    if (cmDocument != null)         
    {    
      namespace = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI");    //$NON-NLS-1$
    }
    return namespace;
  }
View Full Code Here

    }

    protected String getKey(CMNode cmNode)
    {
      String key = cmNode.getNodeName();
      CMDocument cmDocument = (CMDocument)cmNode.getProperty("CMDocument"); //$NON-NLS-1$
      if (cmDocument != null)
      {                        
        String namespaceURI = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI");    //$NON-NLS-1$
        if (namespaceURI != null)
        {  
          key = "[" + namespaceURI + "]" + key; //$NON-NLS-1$ //$NON-NLS-2$
        }
      }
View Full Code Here

        {
          v.addAll(childNodeTable.values());
        }
        else if (contentType == CMElementDeclaration.ANY)
        {     
          CMDocument cmDocument =  (CMDocument)rootElementDeclaration.getProperty("CMDocument"); //$NON-NLS-1$
          if (cmDocument != null)
          {
            CMNamedNodeMap elements = cmDocument.getElements();           
            for (Iterator i = elements.iterator(); i.hasNext(); )
            {
              v.add(i.next());
            }
          }
View Full Code Here

    {           
      String uri = anyElement.getNamespaceURI();                         
      List list = getCMDocumentList(rootElement, rootElementDeclaration, uri);
      for (Iterator iterator = list.iterator(); iterator.hasNext(); )
      {
        CMDocument cmdocument = (CMDocument)iterator.next();
        if (cmdocument != null)
        {                         
          CMNamedNodeMap map = cmdocument.getElements();
          int size = map.getLength();
          for (int i = 0; i < size; i++)
          {                      
            CMNode ed = map.item(i);                 
            addToTable(childNodeTable,ed);
View Full Code Here

        uri = "##any"; //$NON-NLS-1$
      }              

      if (uri.equals("##targetNamespace")) //$NON-NLS-1$
      {                                                     
        CMDocument cmDocument = (CMDocument)ed.getProperty("CMDocument"); //$NON-NLS-1$
        if (cmDocument != null)
        { 
          result.add(cmDocument);
        }
      }
      else if (uri.equals("##any") || uri.equals("##other")) //$NON-NLS-1$ //$NON-NLS-2$
      {                                       
        String excludedURI = null;
        if (uri.equals("##other")) //$NON-NLS-1$
        {
          CMDocument cmDocument = (CMDocument)ed.getProperty("CMDocument");        //$NON-NLS-1$
          if (cmDocument != null)
          {
            excludedURI = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI"); //$NON-NLS-1$
          }
        }
                              
        // in this case we should consider all of the schema related to this document
        //
        NamespaceTable namespaceTable = new NamespaceTable(element.getOwnerDocument());
        namespaceTable.addElementLineage(element);
        List list = namespaceTable.getNamespaceInfoList();
        for (Iterator i = list.iterator(); i.hasNext();)
        {
          NamespaceInfo info = (NamespaceInfo)i.next();
          if (info.uri != null && !info.uri.equals(excludedURI))
          {
            CMDocument document = xmlAssociationProvider.getCMDocument(info.uri, info.locationHint, "XSD"); //$NON-NLS-1$
            if (document != null)
            {
              result.add(document);
            }
          }
        }
      }  
      else
      {       
        CMDocument document = xmlAssociationProvider.getCMDocument(element, uri);
        if (document != null)
        {
          result.add(document);
        }
      }     
View Full Code Here


  public CMDocument getCMDocument(Element element, String uri)
  {               

    CMDocument result = null;
    if (modelQueryAssociationProvider instanceof XMLAssociationProvider)
    {            
      XMLAssociationProvider xmlAssociationProvider = (XMLAssociationProvider)modelQueryAssociationProvider;
      result = xmlAssociationProvider.getCMDocument(element, uri);
    }
View Full Code Here

TOP

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

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.