*
The moose likes XML and Related Technologies and the fly likes DOM and data persistance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "DOM and data persistance" Watch "DOM and data persistance" New topic
Author

DOM and data persistance

Rafal Chmielecki
Greenhorn

Joined: Apr 04, 2001
Posts: 5
Hello
I have a prblem with storing data in the xml file - even if I update the Dom Document object (for example if I add a new node), the source xml file is not updated.
Is there any "flushing" posibilty for a Dom Document object?

------------------
Rafal Chmielecki
Pogrammer
TC:Reaktor (Warsaw, Poland)


Rafal Chmielecki<BR>Pogrammer<BR>Inteligo S.A.(Warsaw, Poland)
Mapraputa Is
Leverager of our synergies
Sheriff

Joined: Aug 26, 2000
Posts: 10065
Rafal, W3C specification DOM level 2 do not define methods for storing XML data in file. All DOM implementations provide extensions for it. For example, with MS DOM implementation for IE and JavaScript you would use XMLDOMDocument.save() method; with JDOM - XMLOutputter class and output () method. You should check documentation for your DOM implementation.
I think I read somewhere that DOM level3 will define methods for writing XML in file, but I am not sure.
Ah, yes, found it: Document Object Model (DOM) Level 3 Content Models and Load and Save Specification
[This message has been edited by Mapraputa Is (edited April 04, 2001).]


Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
Yashnoo lyo
Ranch Hand

Joined: Feb 17, 2003
Posts: 152
Hi Mapraputa Is:
I have this problem and doesn't resolve it.Have you any idea to do this? That document you give seem can't help. I can't find any object to save node to xml file. It says:"permission denied"
If anyone have method to save text to xml file please help me.
Thanks in advanced!


When I face C# and Java I choose Java.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
http://www.javaalmanac.com/egs/javax.xml.transform/WriteDom.html?l=find


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Yashnoo lyo
Ranch Hand

Joined: Feb 17, 2003
Posts: 152
Oh Thks
oh I know.It means that I must do it using Java other than scriplet. I will use dom4j or jdom.
Some times I hope that java has some scriplet that can control xml like JScript or VBScript.
 
Consider Paul's rocket mass heater.
 
subject: DOM and data persistance