Package org.w3c.dom

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


      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

    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

        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

    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

        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

    private void getGenerators(Document doc, LogConfiguration lc) {
        String currentGenerator = "default";
        NodeList nl = doc.getElementsByTagName("generator");
        for (int i = 0; i < nl.getLength(); i++) {
            Node n = nl.item(i);
            NamedNodeMap curAtt = n.getAttributes();
            Node curNode = curAtt.getNamedItem("name");
            if (curNode != null) {
                currentGenerator = curNode.getNodeValue();
            }
            Hashtable params = new Hashtable();
            Map fParams = new HashMap();
View Full Code Here

            lc.addLogGenerator(generator);
        }
    }

    private Handler getHandler(Node n,String configName) {
        NamedNodeMap myAtt = n.getAttributes();
        Node myNode = myAtt.getNamedItem("class");
        if ( myNode != null ) {
            String handlerName = myNode.getNodeValue();
            if (handlerName != null) {
                // next we set the formatter
                Handler handler = HandlerFactory.getHandler(handlerName,configName);
View Full Code Here

        }
        return null;
    }

    private Formatter getFormatter(Node n,String configName) {
        NamedNodeMap myAtt = n.getAttributes();
        Node myNode = myAtt.getNamedItem("class");
        if ( myNode != null ) {
            String formatterName = myNode.getNodeValue();
            Formatter formatter = null;
            if (formatterName != null) {
                // next we set the formatter
View Full Code Here

        Map params = new HashMap();
        for (Node child = n.getFirstChild();child != null;child = child.getNextSibling()) {
            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

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.