Instead of unconditionally adding the element, instead use an if-statement to see if the string is "Hello", and if it is, then throw an exception?
I put a question mark there because you really don't have a specific question. You have a vague description of a system with numerous components and you want to change one of those components in some way (surely not just to exclude the word "Hello"). A specific question would be far more practical. If you have code which you want to change, then posting that code would be useful too.
Joined: Mar 30, 2010
here with i m sending the code...can you check it..
// adding a node after the last child node of the specified node.
Element child1 = doc.createElement("STATUS");
Text text = doc.createTextNode(id);
Element element = doc.createElement("QUAL");
Text text1 = doc.createTextNode(name);
// TransformerFactory instance is used to create Transformer objects.
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer();
// create string from xml tree
StringWriter sw = new StringWriter();
StreamResult result = new StreamResult(sw);
DOMSource source = new DOMSource(doc);
String xmlString = sw.toString();
File file = new File("E:/login.xml");
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(
can you suggest me where to do the modifications..