• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

org.w3c.dom & save xml documents

 
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
 
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 ]
 
Did you ever grow anything in the garden of your mind? - Fred Rogers. Tiny ad:
ScroogeXHTML 8.7 - RTF to HTML5 and XHTML converter
https://coderanch.com/t/730700/ScroogeXHTML-RTF-HTML-XHTML-converter
    Bookmark Topic Watch Topic
  • New Topic