@Test public void testUpdateFirstElement() throws SAXParseException { URL resource = getClass().getResource("eml.xml"); File f = new File(resource.getFile()); XmlFileUpdater updater = new XmlFileUpdater(f); updater.readFile(); updater.updateFirstElement("pubDate", "2017-08-08T00:00:00"); }
public void updateFirstElement(String name, String value) { Element e = getDescendant(getDocumentElement(), name); if (e == null) { throw new IllegalArgumentException("No such element: " + name); } e.setTextContent(value); }
XmlFileUpdater { public void updateFirstElement(String name, String value) { Element e = getDescendant(getDocumentElement(), name); if (e == null) { throw new IllegalArgumentException("No such element: " + name); } e.setTextContent(value); } }
XmlFileUpdater { public void updateFirstElement(String name, String value) { Element e = getDescendant(getDocumentElement(), name); if (e == null) { throw new IllegalArgumentException("No such element: " + name); } e.setTextContent(value); } XmlFileUpdater(File file); }
XmlFileUpdater { public void updateFirstElement(String name, String value) { Element e = getDescendant(getDocumentElement(), name); if (e == null) { throw new IllegalArgumentException("No such element: " + name); } e.setTextContent(value); } XmlFileUpdater(File file); boolean isNamespaceAware(); void setNamespaceAware(boolean nsAware); boolean isValidating(); void setValidating(boolean validating); void readFile(); void updateFirstElement(String name, String value); void save(); void save(File file); void save(OutputStream out); }
XmlFileUpdater { public void updateFirstElement(String name, String value) { Element e = getDescendant(getDocumentElement(), name); if (e == null) { throw new IllegalArgumentException("No such element: " + name); } e.setTextContent(value); } XmlFileUpdater(File file); boolean isNamespaceAware(); void setNamespaceAware(boolean nsAware); boolean isValidating(); void setValidating(boolean validating); void readFile(); void updateFirstElement(String name, String value); void save(); void save(File file); void save(OutputStream out);  }