List of usage examples for org.w3c.dom Text substringData
public String substringData(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);/*from w w w.jav a 2 s .c o m*/ //String bridge = directions.substringData(offset,count); String bridge = directions.substringData(2, 3); name.appendData(bridge); }
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);/*from www . j av a 2s .c om*/ //String bridge = directions.substringData(offset,count); String bridge = directions.substringData(2, 3); name.appendData(bridge); }