Package org.w3c.dom

Examples of org.w3c.dom.NamedNodeMap


          {
            boolean elementHasXMLNS = false;

            if (parentType == Node.ELEMENT_NODE)
            {
              NamedNodeMap nnm = parent.getAttributes();

              for (int i = 0; i < nnm.getLength(); i++)
              {
                Node attr = nnm.item(i);
                String aname = attr.getNodeName();

                if (aname.charAt(0) == 'x')
                {
                  boolean isPrefix = aname.startsWith("xmlns:");
View Full Code Here


    String url = "";
    DocumentType doctype = doc.getDoctype();

    if (null != doctype)
    {
      NamedNodeMap entities = doctype.getEntities();
      if(null == entities)
        return url;
      Entity entity = (Entity) entities.getNamedItem(name);
      if(null == entity)
        return url;
     
      String notationName = entity.getNotationName();
View Full Code Here

      {
        if (type == Node.ELEMENT_NODE)
        {
                if (parent.getNodeName().indexOf(prefix+":") == 0)
                        return parent.getNamespaceURI();               
          NamedNodeMap nnm = parent.getAttributes();

          for (int i = 0; i < nnm.getLength(); i++)
          {
            Node attr = nnm.item(i);
            String aname = attr.getNodeName();
            boolean isPrefix = aname.startsWith("xmlns:");

            if (isPrefix || aname.equals("xmlns"))
            {
View Full Code Here

            while ((null != parent) && (null == namespace)
                && (((type = parent.getNodeType()) == Node.ELEMENT_NODE)
                    || (type == Node.ENTITY_REFERENCE_NODE))) {

                if (type == Node.ELEMENT_NODE) {
                    NamedNodeMap nnm = parent.getAttributes();

                    for (int i = 0; i < nnm.getLength(); i++) {
                        Node attr = nnm.item(i);
                        String aname = attr.getNodeName();
                        boolean isPrefix = aname.startsWith("xmlns:");

                        if (isPrefix || aname.equals("xmlns")) {
                            int index = aname.indexOf(':');
View Full Code Here

      break;
    case Node.DOCUMENT_NODE :
   
      break;
    case Node.ELEMENT_NODE :
      NamedNodeMap atts = ((Element) node).getAttributes();
      int nAttrs = atts.getLength();
      // System.out.println("TreeWalker#startNode: "+node.getNodeName());

      for (int i = 0; i < nAttrs; i++)
      {
        Node attr = atts.item(i);
        String attrName = attr.getNodeName();

        // System.out.println("TreeWalker#startNode: attr["+i+"] = "+attrName+", "+attr.getNodeValue());
        if (attrName.equals("xmlns") || attrName.startsWith("xmlns:"))
        {
View Full Code Here

        ns = "";
      this.m_contentHandler.endElement(ns,
                                         m_dh.getLocalNameOfNode(node),
                                         node.getNodeName());

      NamedNodeMap atts = ((Element) node).getAttributes();
      int nAttrs = atts.getLength();

      for (int i = 0; i < nAttrs; i++)
      {
        Node attr = atts.item(i);
        String attrName = attr.getNodeName();

        if (attrName.equals("xmlns") || attrName.startsWith("xmlns:"))
        {
          int index;
View Full Code Here

        switch (rootNode.getNodeType()) {                         
          case Node.ELEMENT_NODE:
              result.add(rootNode);
                  Element el=(Element)rootNode;
                if (el.hasAttributes()) {
                    NamedNodeMap nl = ((Element)rootNode).getAttributes();
                    for (int i=0;i<nl.getLength();i++) {
                      result.add(nl.item(i));
                    }
                }
                //no return keep working
          case Node.DOCUMENT_NODE:             
              for (Node r=rootNode.getFirstChild();r!=null;r=r.getNextSibling()){                                   
View Full Code Here

         case Node.ELEMENT_NODE :
           Element element = (Element) node;
             if (!element.hasChildNodes())
               break;
             if (element.hasAttributes()) {              
             NamedNodeMap attributes = element.getAttributes();          
             int attributesLength = attributes.getLength();   
            
             for (Node child = element.getFirstChild(); child!=null;
               child=child.getNextSibling()) {           

               if (child.getNodeType() != Node.ELEMENT_NODE) {
                 continue;
               }
               Element childElement = (Element) child;

               for (int i = 0; i < attributesLength; i++) {
                 Attr currentAttr = (Attr) attributes.item(i);
                 if (!namespaceNs.equals(currentAttr.getNamespaceURI()))
                   continue;
                 if (childElement.hasAttributeNS(namespaceNs,
                  currentAttr.getLocalName())) {
                     continue;
View Full Code Here

     * @return the value of this element.
     */
    public static String getAttributeValue(final Element base, final String name) {

        // get attribute of this element...
        NamedNodeMap mapAttributes = base.getAttributes();
        Node node = mapAttributes.getNamedItem(name);
        if (node != null) {
            return node.getNodeValue();
        }
        return null;
    }
View Full Code Here

     * @param mbeanNode mbean XML Node
     */
    private static void processMBeanNode(final Registry registry, final Node mbeanNode) {
        // EasyBeans Change ---------------------------------------------
        // Get the mbean name
        NamedNodeMap attrs = mbeanNode.getAttributes();
        Node n = attrs.getNamedItem("name");
        String mbeanName = n.getNodeValue();

        // Get the ManagedBean
        ManagedBean managed = registry.findManagedBean(mbeanName);
        // /EasyBeans Change ---------------------------------------------
View Full Code Here

TOP

Related Classes of org.w3c.dom.NamedNodeMap

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.