Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

dom with VB and Javascript

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
iam able to modify and save the modification of an xml file using VB like this
dim dom as DOMDocument
set dom = new DOMDocument
dom.load("xml file")
dom.documentElement.childNodes.item(0).text = "sam"
dom.save("xml file")
here iam changing the value of the first child of an xml file to "sam" and saving it. It gets saved.
But when i do the same thing using javascript i.e
when i use the statement
dom.save("xml file") it shows "permission denied" as the error.
can anyone tell me how to modify an xml and save it using javascript.
advance thanks
sivakumar.
 
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was waiting for an answer too, but since nobody answered, I'll try.
First, I also wonder if it's possible to save XML files on server with JavaScript. For usual (non-XML) files we have to use special objects, like FileSystemObject, which is part of Microsoft' Scripting Engine http://www.webreference.com/js/column71/
or ActiveX File object (M$ again) http://www.webreference.com/js/tips/001031.html
Second, DOM is an interface and when we �use� it we have to deal with particular DOM implementation. In case of JavaScript, we have to deal with browser�s DOM implementation, i.e. IE DOM implementation or NN DOM implementation, depending on what browser do you use. If all your clients use only one browser, JavaScript approach is OK, if not, you will face famous incompatibility problem.
This text highlight differences in IE and NN's DOM support: http://www.xs4all.nl/~ppk/js/index.html?version5.html
I did not find any analog of �dom.save�
Changing XML files on server-side could be a better solution, JSP + any available parser will work.
Everybody are welcome to correct me.
 
Mapraputa Is
Leverager of our synergies
Posts: 10065
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, Microsoft�s XMLDOMDocument object has a method
objXMLDOMDocument.save(objTarget);
- saves an XML document to the specified location.
http://msdn.microsoft.com/xml/reference/scriptref/XMLDOMDocument_save.asp

[This message has been edited by Mapraputa Is (edited March 20, 2001).]
reply
    Bookmark Topic Watch Topic
  • New Topic