tia_kamakshi
asked on
Saving Xml file Java
Hi,
I am working on Java, I am changing an Attribute of XML file
From the code below
But When I open the excel file in notepad.
I cannot see the changed value.
Can you please help me
Also, If I wanted to save the file with different name.
How do we do that
Please guide
I am working on Java, I am changing an Attribute of XML file
From the code below
But When I open the excel file in notepad.
I cannot see the changed value.
Can you please help me
Also, If I wanted to save the file with different name.
How do we do that
Please guide
public void readDijXML(File file)
throws Exception
{
BaseBL baseBL = new BaseBL();
Document doc = baseBL.getXMLDocument(file);
NodeList nodeLst = doc.getElementsByTagName("document");
System.out.println("Information of all employees"+nodeLst.getLength());
for (int s = 0; s < nodeLst.getLength(); s++)
{
Node fstNode = nodeLst.item(s);
if (fstNode.getNodeType() == Node.ELEMENT_NODE) {
Element fstElmnt = (Element) fstNode;
NodeList fstNmElmntLst = fstElmnt.getElementsByTagName("DDSDocValue");
Element fstNmElmnt = (Element) fstNmElmntLst.item(0);
fstNmElmnt.setAttribute("name", "Test Attribute Changes Success");
}
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Many Thanks
:-)
:-)
ASKER
Thanks allot. I will come back to you on this by tommorow.
Many Thanks again