Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

get,modify and save xml file on server using javascript

843833Apr 20 2008
i have one application in which i have one xml file on the server
i want to get that xml file through javascript on client and modify some xml elements and at last i want to save that modified file on the server

i tried some thing as follows
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=koi8-r" />
<title>AnyChart Gantt Chart columns sample</title>
 
<script type="text/javascript">
// code for IE
if (window.ActiveXObject)
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
}
// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation.createDocument)
{
xmlDoc=document.implementation.createDocument("","",null);
}
else
{
alert('Your browser cannot handle this script');
}
xmlDoc.async=false;
xmlDoc.load("http://localhost:8080/dbServlet/columns.xml");
 
x=xmlDoc.getElementsByTagName("category");
 
  x[0].setAttribute("caption","ghanta");
 
 
//Output all attribute values
 
document.write(x[0].getAttribute('caption'));
xmlDoc.save("http://localhost:8080/dbServlet/columns.xml");
</script>
</head>
<body bgcolor="#ffffff">
 
</body>
</html>
but its not saving the modified xml file on the server

note::even no errors thrown on status bar
please help me ASAP
thanks in advance
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 18 2008
Added on Apr 20 2008
0 comments
187 views