Package org.w3c.dom

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


            return null;
        if (!"entity-engine-xml".equals(docElement.getTagName())) {
            Debug.logError("[GenericDelegator.makeValues] Root node was not <entity-engine-xml>", module);
            throw new java.lang.IllegalArgumentException("Root node was not <entity-engine-xml>");
        }
        docElement.normalize();
        Node curChild = docElement.getFirstChild();

        if (curChild != null) {
            do {
                if (curChild.getNodeType() == Node.ELEMENT_NODE) {
View Full Code Here


    public License[] getLicenses() {
        Element licenses = getFirstChildElement(projectElement, LICENSES);
        if (licenses == null) {
            return new License[0];
        }
        licenses.normalize();
        List/* <License> */lics = new ArrayList();
        for (Iterator it = getAllChilds(licenses).iterator(); it.hasNext();) {
            Element license = (Element) it.next();
            if (LICENSE.equals(license.getNodeName())) {
                String name = getFirstChildText(license, LICENSE_NAME);
View Full Code Here

     */
    public Map/* <String,String> */getPomProperties() {
        Map pomProperties = new HashMap();
        Element propsEl = getFirstChildElement(projectElement, PROPERTIES);
        if (propsEl != null) {
            propsEl.normalize();
        }
        for (Iterator it = getAllChilds(propsEl).iterator(); it.hasNext();) {
            Element prop = (Element) it.next();
            pomProperties.put(prop.getNodeName(), getTextContent(prop));
        }
View Full Code Here

           
            QName nn = new QName("http://gizmos.com/orders/", "order");
            Iterator<Element> it = CastUtils.cast(detail.getChildElements(nn));
            assertTrue(it.hasNext());
            Element el = it.next();
            el.normalize();
            assertEquals("Quantity element does not have a value", el.getFirstChild().getNodeValue());
            el = it.next();
            el.normalize();
            assertEquals("Incomplete address: no zip code", el.getFirstChild().getNodeValue());
        }       
View Full Code Here

            assertTrue(it.hasNext());
            Element el = it.next();
            el.normalize();
            assertEquals("Quantity element does not have a value", el.getFirstChild().getNodeValue());
            el = it.next();
            el.normalize();
            assertEquals("Incomplete address: no zip code", el.getFirstChild().getNodeValue());
        }       
    }
   
    /*-------------------------------------------------------
 
View Full Code Here

            Element[] existingDocumentElements = helper.getChildren(collectionElement, ELEMENT_DOCUMENT);
            for (int i = 0; i < existingDocumentElements.length; i++) {
                collectionElement.removeChild(existingDocumentElements[i]);
            }
           
            collectionElement.normalize();
           
            NodeList emptyTextNodes = XPathAPI.selectNodeList(collectionElement, "text()");
            for (int i = 0; i < emptyTextNodes.getLength(); i++) {
                Node node = emptyTextNodes.item(i);
                collectionElement.removeChild(node);
View Full Code Here

            throws DocumentException {
        Element element = super.createDocumentElement(document, helper);
        String path = getXlinkHref(document);
        element.setAttributeNS(XLink.XLINK_NAMESPACE, "xlink:" + XLink.ATTRIBUTE_HREF, path);
        element.setAttributeNS(XLink.XLINK_NAMESPACE, "xlink:" + XLink.ATTRIBUTE_SHOW, "embed");
        element.normalize();
        return element;
    }

    /**
     * Returns the href attribute string for a certain document.
View Full Code Here

        Element keyNmElem =
                (Element) WSSecurityUtil.getDirectChild(keyInfoElem,
                        "KeyName",
                        WSConstants.SIG_NS);
        if (keyNmElem != null) {
            keyNmElem.normalize();
            Node tmpN;
            if ((tmpN = keyNmElem.getFirstChild()) != null
                    && tmpN.getNodeType() == Node.TEXT_NODE) {
                keyName = tmpN.getNodeValue();
            }
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

         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)
      {
         throw new ConfigurationException("Could not parse the config file", 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.