Package org.w3c.dom

Examples of org.w3c.dom.NamedNodeMap


      {
         throw new Exception("Expecting <database-configuration> and got <" +
                             dbcn.getNodeName() + ">");
      }

      NamedNodeMap attrs = dbcn.getAttributes();
      Node nameNode = attrs.getNamedItem("name");
      String configName = nameNode.getNodeValue();
      DatabaseConfiguration dbc = new DatabaseConfiguration();
      dbConfigurations.put(configName, dbc);

      if (dbcn.hasChildNodes())
View Full Code Here


            Node n=list.item(i);
            if (n.hasChildNodes()) outputMetadata(n, delimiter);
            System.out.println(delimiter + n.getNodeName());
            if (list.item(i).hasAttributes())
            {
                NamedNodeMap nnm = list.item(i).getAttributes();
                String ndel = "  "+delimiter + "-A:";
                for (int j = 0; j < nnm.getLength(); j++) {
                    System.out.println(ndel + nnm.item(j).getNodeName()+":"+nnm.item(j).getNodeValue());
                }
            }

        }
    }
View Full Code Here

                                         delegate.getNodeName() + "!");
      }

      this.delegate = (Element)delegate;

      NamedNodeMap attrs = delegate.getAttributes();

      Node mbeanNameAttr = attrs.getNamedItem("name");
      on = new ObjectName(mbeanNameAttr.getNodeValue());
     
      log.trace("ObjectName is: " + on);

      Node mbeanCodeAttr = attrs.getNamedItem("code");
      className = mbeanCodeAttr.getNodeValue();

      Node mbeanXMBeanDD = attrs.getNamedItem("xmbean-dd");
      if (mbeanXMBeanDD != null)
      {
         xmbeandd = mbeanXMBeanDD.getNodeValue();
      }

      mbeanConfigAttributes = new HashMap();
      mbeanOptionalAttributeNames = new HashMap();
      constructors = new ArrayList();

      if (delegate.hasChildNodes())
      {
         NodeList l = delegate.getChildNodes();
         for(int i = 0; i < l.getLength(); i ++)
         {
            Node mbeanConfigNode = l.item(i);
            String mbeanConfigNodeName = mbeanConfigNode.getNodeName();
            if ("attribute".equals(mbeanConfigNodeName))
            {
               attrs = mbeanConfigNode.getAttributes();
               String configAttribName = attrs.getNamedItem("name").getNodeValue();
               String configAttribValue = null;
               Node n = attrs.getNamedItem("value");
               if (n != null)
               {
                  configAttribValue = n.getNodeValue();
               }
               else
               {
                  configAttribValue = XMLUtil.getTextContent(mbeanConfigNode);
               }
               configAttribValue = XMLUtil.stripCDATA(configAttribValue);

               mbeanConfigAttributes.put(configAttribName, configAttribValue);
            }
            else if ("depends".equals(mbeanConfigNodeName))
            {
               attrs = mbeanConfigNode.getAttributes();
               Node optionalAttributeNode = attrs.getNamedItem("optional-attribute-name");
               if (optionalAttributeNode != null)
               {
                  String optionalAttributeName = optionalAttributeNode.getNodeValue();
                  String optionalAttributeValue = XMLUtil.getTextContent(mbeanConfigNode);
                  mbeanOptionalAttributeNames.put(optionalAttributeName, optionalAttributeValue);
               }
            }
            else if ("constructor".equals(mbeanConfigNodeName))
            {
               ConstructorElement c = new ConstructorElement(mbeanConfigNode);
               constructors.add(c);

               if (mbeanConfigNode.hasChildNodes())
               {
                  NodeList nl = mbeanConfigNode.getChildNodes();
                  for(int j = 0; j < nl.getLength(); j++)
                  {
                     Node n = nl.item(j);
                     String name = n.getNodeName();
                     if ("arg".equals(name))
                     {
                        NamedNodeMap at = n.getAttributes();
                        Node attributeNode = at.getNamedItem("type");
                        Class type = stringToClass(attributeNode.getNodeValue());
                        attributeNode = at.getNamedItem("value");
                        String value = attributeNode.getNodeValue();
                        c.addArgument(type, value, attributeNode);
                     }
                  }
               }
View Full Code Here

         Node n = (Node)i.next();
         if (n.getNodeName().equals("mbean"))
         {
            try
            {
               NamedNodeMap attrs = n.getAttributes();
               Node name = attrs.getNamedItem("name");
               ObjectName on = new ObjectName(name.getNodeValue());
               String s = on.getKeyProperty(objectNameKey);
               if (objectNameValue.equals(s))
               {
                  if (result == null)
View Full Code Here

      BeanDefinitionHolder definitionHolder, BeanDefinition containingBd) {

    BeanDefinitionHolder finalDefinition = definitionHolder;

    // Decorate based on custom attributes first.
    NamedNodeMap attributes = ele.getAttributes();
    for (int i = 0; i < attributes.getLength(); i++) {
      Node node = attributes.item(i);
      finalDefinition = decorateIfRequired(node, finalDefinition, containingBd);
    }

    // Decorate based on custom nested elements.
    NodeList children = ele.getChildNodes();
View Full Code Here

        }
      }
    }

    // Then check Attributes
    NamedNodeMap attrs = schema.getElement().getAttributes();
    int m = attrs.getLength();
    for (int j = 0; j < m; j++) {
      Node attr = attrs.item(j);

      String nodeName = attr.getNodeName();
      String[] split = nodeName.split(":");
      if (split.length == 2 && split[0].equals(namespaceName)) {
        result.put(split[1], attr.getNodeValue());
View Full Code Here

   
    void getAttributes(Object node, String localName, String namespaceUri, List result) {
        if(node instanceof Element) {
            Element e = (Element)node;
            if(localName == null) {
                NamedNodeMap atts = e.getAttributes();
                for(int i = 0; i < atts.getLength(); ++i) {
                    result.add(atts.item(i));
                }
            }
            else {
                if("".equals(namespaceUri)) {
                    namespaceUri = null;
View Full Code Here

        NodeList children = root.getChildNodes();
        for (int i=0; i<children.getLength(); i++) {
            Node n = children.item(i);
            if (n.getNodeType() == Node.ELEMENT_NODE) {
                if (n.getNodeName().equals("config")) {
                    NamedNodeMap atts = n.getAttributes();
                    for (int j=0; j<atts.getLength(); j++) {
                        Attr att = (Attr) atts.item(j);
                        configParams.put(att.getName(), att.getValue());
                    }
                }
                if (n.getNodeName().equals("testcase")) {
                    TestCase tc = createTestCaseFromNode((Element) n);
View Full Code Here

            System.out.println("Setting " + key +  " to " + value);
            result.setConfigParam(entry.getKey().toString(), entry.getValue().toString());
        }
        NodeList configs = e.getElementsByTagName("config");
        for (int i=0; i<configs.getLength(); i++)  {
            NamedNodeMap atts = configs.item(i).getAttributes();
            for (int j=0; j<atts.getLength(); j++) {
                Attr att = (Attr) atts.item(j);
                result.setConfigParam(att.getName(), att.getValue());
            }
        }
        return result;
    }
View Full Code Here

   */
  private FontFamily parseFontFamily(Node fontFamilyNode) throws SAXException
  {
    SimpleFontFamily fontFamily = new SimpleFontFamily();
   
    NamedNodeMap nodeAttrs = fontFamilyNode.getAttributes();
   
    if (nodeAttrs.getNamedItem(ATTRIBUTE_name) != null)
    {
      fontFamily.setName(nodeAttrs.getNamedItem(ATTRIBUTE_name).getNodeValue());
    }

    NodeList nodeList = fontFamilyNode.getChildNodes();
    for(int i = 0; i < nodeList.getLength(); i++)
    {
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.