Examples of replaceWholeText()


Examples of org.w3c.dom.Text.replaceWholeText()

            element.setTextContent( value );
          } else if( node instanceof Text ) {
            Text text = (Text)node;
            String value = text.getWholeText();
            value = filterText( extractQName( text.getParentNode() ), value, apply.rule() );
            text.replaceWholeText( value );
          } else if( node instanceof Attr ) {
            Attr attr = (Attr)node;
            String value = attr.getValue();
            value = filterAttribute( extractQName( attr.getOwnerElement() ), extractQName( attr ), value, apply.rule() );
            attr.setValue( value );
View Full Code Here

Examples of org.w3c.dom.Text.replaceWholeText()

            //TEST replaceWholeText()
            ((NodeImpl)ls.item(0)).setReadOnly(true, true);
           
            Text original = (Text)ls.item(0);
            Node newNode = original.replaceWholeText("Replace with this text");
            ls = test.getChildNodes();
            Assertion.verify(ls.getLength() == 1, "Length == 1");
            Assertion.verify(ls.item(0).getNodeValue().equals("Replace with this text"), "Replacement works");
            Assertion.verify(newNode != original, "New node created");
View Full Code Here

Examples of org.w3c.dom.Text.replaceWholeText()

            Assertion.verify(newNode != original, "New node created");

            // replace text for node which is not yet attached to the tree
            Text text = doc.createTextNode("readonly");
            ((NodeImpl)text).setReadOnly(true, true);
            text = text.replaceWholeText("Data");
            Assertion.verify(text.getNodeValue().equals("Data"), "New value 'Data'");

            // test with second child that does not have any content
            test = (Element)doc.getElementsByTagName("elem").item(1);
            try {           
View Full Code Here

Examples of org.w3c.dom.Text.replaceWholeText()

                Text text = createTextNode(node.getNodeValue());
                node.parent.insertBefore(text, node);
                node.parent.removeChild(node);
                // merge adjacent text nodes
                String data = text.getWholeText();
                node = (DomNode) text.replaceWholeText(data);
              }
            else if (config.splitCdataSections)
              {
                String value = node.getNodeValue();
                int i = value.indexOf("]]>");
View Full Code Here

Examples of org.w3c.dom.Text.replaceWholeText()

            element.setTextContent( value );
          } else if( node instanceof Text ) {
            Text text = (Text)node;
            String value = text.getWholeText();
            value = filterText( extractQName( text.getParentNode() ), value, apply.rule() );
            text.replaceWholeText( value );
          } else if( node instanceof Attr ) {
            Attr attr = (Attr)node;
            String value = attr.getValue();
            value = filterAttribute( extractQName( attr.getOwnerElement() ), extractQName( attr ), value, apply.rule() );
            attr.setValue( value );
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.