This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic