Package org.w3c.dom

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


                for(int i = 0; i < childs.getLength(); i++) {
                    current = childs.item(i);

                    // only element nodes
                    if (current.getNodeType() == Node.ELEMENT_NODE) {
                        current.normalize();
                        NodeList valueChilds = current.getChildNodes();
                        String   key;
                        StringBuffer   valueBuffer;
                        String         value;
View Full Code Here


                        }
                    }

                    // now the last check: ID must have a TEXT child
                    if (found == true) {
                        child.normalize(); // join text nodes
                        if (child.hasChildNodes() == true &&
                            child.getChildNodes().getLength() == 1 &&
                            child.getChildNodes().item(0).getNodeType() == Node.TEXT_NODE) {
                            String value = child.getChildNodes().item(0).getNodeValue().trim();
                            if (value.length() > 0) isValid = true;
View Full Code Here

                    // this is not new

                    // do we have elements as children or text?
                    if (currentDelta.hasChildNodes()) {
                        currentDelta.normalize();
                        currentProfile.normalize();
                        // do a recursive call for sub elements
                        this.importNode((Element)currentProfile, (Element)currentDelta);
                        // and now the text nodes: Remove all from the profile and add all
                        // of the delta
                        NodeList childs = currentProfile.getChildNodes();
View Full Code Here

          angle.setTextContent(Double.toString(r.getAngle()));
          li.appendChild(angle);
        }
       
        // Check if update is necessary
        rdfTag.normalize();
        if (!packet.storeXML(doc)) {
          comment ="validated.";
          break process;
        }
       
View Full Code Here

                for(int i = 0; i < childs.getLength(); i++) {
                    current = childs.item(i);

                    // only element nodes
                    if (current.getNodeType() == Node.ELEMENT_NODE) {
                        current.normalize();
                        NodeList valueChilds = current.getChildNodes();
                        String   key;
                        StringBuffer   valueBuffer;
                        String         value;
View Full Code Here

                        }
                    }

                    // now the last check: ID must have a TEXT child
                    if (found == true) {
                        child.normalize(); // join text nodes
                        if (child.hasChildNodes() == true &&
                            child.getChildNodes().getLength() == 1 &&
                            child.getChildNodes().item(0).getNodeType() == Node.TEXT_NODE) {
                            String value = child.getChildNodes().item(0).getNodeValue().trim();
                            if (value.length() > 0) isValid = true;
View Full Code Here

                                              currentProfile);
                    } else {
                        // do we have elements as children or text?
                        if (currentDelta.hasChildNodes() == true) {
                            currentDelta.normalize();
                            currentProfile.normalize();
                            // do a recursive call for sub elements
                            this.importNode((Element)currentProfile, (Element)currentDelta, preserve);
                            // and now the text nodes: Remove all from the profile and add all
                            // of the delta
                            NodeList childs = currentProfile.getChildNodes();
View Full Code Here

        if ( attributes!=null )
        {
            for( int i=0; i<attributes.getLength(); ++i )
            {
                Node attr = attributes.item(i);
                attr.normalize();
            }
        }

      // changed() will have occurred when the removeChild() was done,
      // so does not have to be reissued.
View Full Code Here

                    else if (resultObject instanceof Text)
                    {
                        Node parentNode = ((Text)resultObject).getParentNode();
                        if (parentNode instanceof Element)
                        {
                            parentNode.normalize();
                            targetAttributeName = IAttributeValueResolver.TEXT_NODE_KEY;
                            oldAttributeValue = ((Text)resultObject).getNodeValue();
                        }
                    }
                }
View Full Code Here

                    else if (resultObject instanceof Text)
                    {
                        Node parentNode = ((Text)resultObject).getParentNode();
                        if (parentNode instanceof Element)
                        {
                            parentNode.normalize();
                            targetAttributeName = IAttributeValueResolver.TEXT_NODE_KEY;
                            oldAttributeValue = ((Text)resultObject).getNodeValue();
                        }
                    }
                }
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.