| Author |
read an write
|
mark smith
Ranch Hand
Joined: Apr 05, 2005
Posts: 240
|
|
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
Joined: May 26, 2006
Posts: 103
|
|
|
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.
|
Holla at me...<br /><a href="http://codeforfun.wordpress.com" target="_blank" rel="nofollow">http://codeforfun.wordpress.com</a>
|
 |
 |
|
|
subject: read an write
|
|
|