Package org.w3c.dom

Examples of org.w3c.dom.Element.normalize()


      DocumentBuilder db = dbf.newDocumentBuilder();
      Document doc = db.parse(config);

      Element rootElement = (Element) doc.getDocumentElement();

      rootElement.normalize();

      // template dir
      Element templateDir = (Element) rootElement.getElementsByTagName("templateDir").item(0);

      if(templateDir != null && templateDir.getTextContent() != null && !templateDir.getTextContent().isEmpty())
View Full Code Here


    // parse response
    try
    {
      Element rootElement = (Element) doc.getDocumentElement();
      rootElement.normalize();

      // get message
      Message msg = Message.parseMessage(rootElement);

      if(msg != null && !msg.hasSuccess())
View Full Code Here

      DocumentBuilder db = dbf.newDocumentBuilder();
      Document doc = db.parse(config);

      Element rootElement = (Element) doc.getDocumentElement();

      rootElement.normalize();

      if(rootElement.hasAttribute("host") &&
        rootElement.hasAttribute("port") &&
        rootElement.hasAttribute("channel") &&
        rootElement.hasAttribute("ssl"))
View Full Code Here

         DocumentBuilder parser = docBuilderFactory.newDocumentBuilder();
         parser.setEntityResolver(resolver);
         parser.setErrorHandler(errorHandler);
         Document doc = parser.parse(config);
         Element root = doc.getDocumentElement();
         root.normalize();
         return root;
      }
      catch (Exception e) {
         log.error(e);
         throw new ConfigurationException("Could not parse the config file", e);
View Full Code Here

         Element defaultElement = getSingleElementInCoreNS("default", rootElement);
         // there may not be a <default /> element!
         if (defaultElement == null) {
            return new Configuration();
         } else {
            defaultElement.normalize();
            return parseConfiguration(defaultElement);
         }
      } else {
         return gc.getDefaultConfiguration();
      }
View Full Code Here

         Configuration defaultConfig = parseDefaultConfiguration();
         gc = new GlobalConfiguration();
         gc.setDefaultConfiguration(defaultConfig);
         // there may not be a <global /> element in the config!!
         if (globalElement != null) {
            globalElement.normalize();
            configureAsyncListenerExecutor(getSingleElementInCoreNS("asyncListenerExecutor", globalElement), gc);
            configureAsyncSerializationExecutor(getSingleElementInCoreNS("asyncSerializationExecutor", globalElement), gc);
            configureEvictionScheduledExecutor(getSingleElementInCoreNS("evictionScheduledExecutor", globalElement), gc);
            configureReplicationQueueScheduledExecutor(getSingleElementInCoreNS("replicationQueueScheduledExecutor", globalElement), gc);
            configureTransport(getSingleElementInCoreNS("transport", globalElement), gc);
View Full Code Here

         DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
         docBuilderFactory.setNamespaceAware(true);
         DocumentBuilder parser = docBuilderFactory.newDocumentBuilder();
         doc = parser.parse(xmlInp);
         Element root = doc.getDocumentElement();
         root.normalize();
         return root;
      }
      catch (SAXParseException err) {
         log.error("Configurator SAXParse error", err);
      }
View Full Code Here

            String errMsg = "Error Getting UserLogin with userLoginId system: "+e.toString();
            Debug.logError(e, errMsg, module);
        }

        Element showShipmentElement = doc.getDocumentElement();
        showShipmentElement.normalize();

        Element controlAreaElement = UtilXml.firstChildElement(showShipmentElement, "os:CNTROLAREA"); // os
        Element bsrElement = UtilXml.firstChildElement(controlAreaElement, "os:BSR"); // os
        String bsrVerb = UtilXml.childElementValue(bsrElement, "of:VERB"); // of
        String bsrNoun = UtilXml.childElementValue(bsrElement, "of:NOUN"); // of
View Full Code Here

        collectionElement.setAttribute(ATTRIBUTE_TYPE, getType());
        collectionElement.setAttribute(ATTRIBUTE_HREF, getHref());
        collectionElement.setAttribute(ATTRIBUTE_ALL_LANGUAGES, Boolean.toString(showAllLanguages()));


        collectionElement.normalize();

        NodeList emptyTextNodes = XPathAPI.selectNodeList(collectionElement, "text()");
        for (int i = 0; i < emptyTextNodes.getLength(); i++) {
            Node node = emptyTextNodes.item(i);
            node = collectionElement.removeChild(node);
View Full Code Here

                    if (docElement == null) {
                        modelServices = null;
                        return null;
                    }

                    docElement.normalize();

                    String resourceLocation = handler.getLocation();
                    try {
                        resourceLocation = handler.getURL().toExternalForm();
                    } catch (GenericConfigException e) {
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.