Examples of NamedNodeMap


Examples of org.w3c.dom.NamedNodeMap

        final NodeList nodeList = element.getChildNodes();
        assertEquals( "nodeList.getLength()", 1, nodeList.getLength() );
        final Node node = nodeList.item( 0 );
        assertEquals( "element[0].value", value, node.getNodeValue() );

        final NamedNodeMap attributes = element.getAttributes();
        assertEquals( "attributes.getLength()", 0, attributes.getLength() );
    }
View Full Code Here

Examples of org.w3c.dom.NamedNodeMap

        assertEquals( "element.getNodeName()", name, element.getNodeName() );

        final NodeList nodeList = element.getChildNodes();
        assertEquals( "nodeList.getLength()", 0, nodeList.getLength() );

        final NamedNodeMap attributes = element.getAttributes();
        assertEquals( "attributes.getLength()", 1, attributes.getLength() );
        final Node node = attributes.item( 0 );
        assertEquals( "attribute[0].name", key, node.getNodeName() );
        assertEquals( "attribute[0].value", value, node.getNodeValue() );
    }
View Full Code Here

Examples of org.w3c.dom.NamedNodeMap

        final NodeList nodeList = element.getChildNodes();
        assertEquals( "nodeList.getLength()", 1, nodeList.getLength() );
        final Node node = nodeList.item( 0 );
        assertEquals( "element[0].name", childName, node.getNodeName() );

        final NamedNodeMap attributes = element.getAttributes();
        assertEquals( "attributes.getLength()", 0, attributes.getLength() );

    }
View Full Code Here

Examples of org.w3c.dom.NamedNodeMap

  private void buildDOM(Document doc) throws DOMException {
    NodeList nl = doc.getElementsByTagName("component");
    for (int i=0; i<nl.getLength(); i++) {
      Node n = nl.item(i);
      NamedNodeMap nn = n.getAttributes();
      String className = nn.getNamedItem("class").getNodeValue();
      String key = nn.getNamedItem("name").getNodeValue();
      log.info(" name of the class to load: " + className);
      log.info("class will be stored with key " + key+ " in hashtable");
      try {
        Class cl = java.lang.Class.forName(className);
        if (cl!=null){
View Full Code Here

Examples of org.w3c.dom.NamedNodeMap

    private static Configuration toConfiguration( final Element element,
                                                  final String parentPath )
    {
        final DefaultConfiguration configuration =
            new DefaultConfiguration( element.getNodeName(), ELEMENT_LOCATION, parentPath );
        final NamedNodeMap attributes = element.getAttributes();
        final int length = attributes.getLength();
        for( int i = 0; i < length; i++ )
        {
            final Node node = attributes.item( i );
            final String name = node.getNodeName();
            final String value = node.getNodeValue();
            configuration.setAttribute( name, value );
        }
View Full Code Here

Examples of org.w3c.dom.NamedNodeMap

      if (keyOIDAttr != null)
         return keyOIDAttr.getValue();
      */

      // w3c conforming code:
      NamedNodeMap attributes = node.getAttributes();
      if (attributes != null && attributes.getLength() > 0) {
         int attributeCount = attributes.getLength();
         for (int i = 0; i < attributeCount; i++) {
            Attr attribute = (Attr)attributes.item(i);
            if (attribute.getNodeName().equals("oid")) {
               String val = attribute.getNodeValue();
               return val;
            }
         }
View Full Code Here

Examples of org.w3c.dom.NamedNodeMap

    private void getLoggers(Document doc, LogConfiguration lc) {
        String currentLogger;
        NodeList nl = doc.getElementsByTagName("logger");
        for (int i = 0; i < nl.getLength(); i++) {
            Node n = nl.item(i);
            NamedNodeMap curAtt = n.getAttributes();
            Node curNode = curAtt.getNamedItem("name");
            currentLogger = curNode.getNodeValue();
            String lvl = "INFO";
            Vector lgs = new Vector();
            String filter = null;
            for (Node child = n.getFirstChild();child != null;child = child.getNextSibling()) {
View Full Code Here

Examples of org.w3c.dom.NamedNodeMap

        String varName;
        String varValue;
        NodeList nl = doc.getElementsByTagName("variable");
        for (int i = 0; i < nl.getLength(); i++) {
            Node n = nl.item(i);
            NamedNodeMap curAtt = n.getAttributes();
            Node curNode = curAtt.getNamedItem("name");
            varName = curNode.getNodeValue();
            Node valueNode = curAtt.getNamedItem("value");
            varValue = valueNode.getNodeValue();
            if (varName != null && varValue != null) {
                variableManager.addVariable(varName, varValue, lc.getName());
            }
            else {
View Full Code Here

Examples of org.w3c.dom.NamedNodeMap

    private void getChannels(Document doc, LogConfiguration lc) {
        String currentChannel;
        NodeList nl = doc.getElementsByTagName("channel");
        for (int i = 0; i < nl.getLength(); i++) {
            Node n = nl.item(i);
            NamedNodeMap curAtt = n.getAttributes();
            Node curNode = curAtt.getNamedItem("name");
            currentChannel = curNode.getNodeValue();
            String generator = null;
            String mode = "off";
            boolean running = false;
            for (Node child = n.getFirstChild();child != null;child = child.getNextSibling()) {
View Full Code Here

Examples of org.w3c.dom.NamedNodeMap

        for (int i = 0; i < nl.getLength(); i++) {
            String filterName = null;
            String className = null;
            Map params = new HashMap();
            Node n = nl.item(i);
            NamedNodeMap curAtt = n.getAttributes();
            Node curNode = curAtt.getNamedItem("name");
            if ( curNode != null ) {
                filterName = curNode.getNodeValue();
                for (Node child = n.getFirstChild();child != null;child = child.getNextSibling()) {
                    if (child.getNodeName().equals("class")) {
                        className = child.getFirstChild().getNodeValue();
                    }
                    if (child.getNodeName().equals("parameter")) {
                        String pnName = null;
                        String pvName = null;
                        NamedNodeMap childAtt = child.getAttributes();
                        Node pnNode = childAtt.getNamedItem("name");
                        if ( pnNode != null) {
                            pnName = pnNode.getNodeValue();
                        }
                        Node pvNode = childAtt.getNamedItem("value");
                        if ( pvNode != null) {
                            pvName = pvNode.getNodeValue();
                        }
                        if ( pnName != null && pvName != null ) {
                            params.put(pnName,pvName);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.