List of usage examples for org.w3c.dom Text deleteData
public void deleteData(int offset, int count) throws DOMException;
From source file:Main.java
public static void modifyingTextbyCuttingandPasting(Document doc) { Element root = doc.getDocumentElement(); Element place = (Element) root.getFirstChild(); Text name = (Text) place.getFirstChild().getFirstChild(); Text directions = (Text) place.getLastChild().getFirstChild(); // name.deleteData(offset,count); name.deleteData(2, 3); //String bridge = directions.substringData(offset,count); String bridge = directions.substringData(2, 3); name.appendData(bridge);/* ww w . j a v a2s. c o m*/ }
From source file:DOMEdit.java
public static void modifyingTextbyCuttingandPasting(Document doc) { Element root = doc.getDocumentElement(); Element place = (Element) root.getFirstChild(); Text name = (Text) place.getFirstChild().getFirstChild(); Text directions = (Text) place.getLastChild().getFirstChild(); // name.deleteData(offset,count); name.deleteData(2, 3); //String bridge = directions.substringData(offset,count); String bridge = directions.substringData(2, 3); name.appendData(bridge);//from ww w .jav a2 s.c o m }