File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

read an write

 
mark smith
Ranch Hand
Posts: 251
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

i need to read and write a xml file similar to



what is the best way to add an element "turn" in this file?


thanks
 
Clifton Craig
Ranch Hand
Posts: 103
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One way is to use XSLT to transform the document. Read up on the TrAX API to learn how to use it. What you'll do is create an XSLT stylesheet the writes the original XML adding the extra element. Another way is to use the SAX API and implement your writing directly as you read. That may be a little more simple for you but it does not scale well as you need to add more elements change elements, or remove elements. XSLT was designed for changing XML and I'd suggest that if your needs tend to grow.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic