• Post Reply Bookmark Topic Watch Topic
  • New Topic

org.w3c.dom & save xml documents

 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I know , this hs nothig to do with the "certification" but it has with xml.
I use from java the org.w3c.dom.Document to create a xml Document, but
I don't know how to save it.
ThankX
 
Hari Vignesh Padmanaban
Ranch Hand
Posts: 578
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi mihai,
can you explain it in detail a little more ?
are u loading teh xml file, making modifications , but not able to store ( i had written paste before instead of store ..sorry abt that ..guess i was sleepy ) it ?
it would be great if you could paste your java code here !!!
looking forward to that
hari
[ March 26, 2004: Message edited by: Hari Vignesh Padmanaban ]
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I create the dom document using
javax.xml.parsers.DocumentBuilder.parse(File f)
where f is a new file(f = new File())
I use the document like
doc.createAttribute(..
...
But how I save it ?
 
Hari Vignesh Padmanaban
Ranch Hand
Posts: 578
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess that you have to use the transformer factory to write it to disk
Here is the code snipet


do go through the related API's
hope this helps
[ March 26, 2004: Message edited by: Hari Vignesh Padmanaban ]
[ March 26, 2004: Message edited by: Hari Vignesh Padmanaban ]
 
The only taste of success some people get is to take a bite out of you. Or this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!