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

how to insert header

 
uma prem
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,

I am new to programming, need your kind help :

Currently I have a set of xml files in a folder consisting of single xml per file. I need to insert the below header for each xml. How can i do this
<header>
<identifier>ip:abc:12345</identifier>
<datestamp>datetimestampZ</datestamp>
<setSpec>active</setSpec>
</header>

Please help

 
Ulf Dittmer
Rancher
Pie
Posts: 42966
73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any of DOM libraries can do that: DOM, JDOM, XOM, dom4j, ...
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13048
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alternately you could treat it as a pure text manipulation problem.

You would learn much more useful Java programming by doing as Ulf suggests.

How big are these files that have to be modified?

Bill
 
uma prem
Greenhorn
Posts: 11
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ulf Dittmer

Hi William,

The file size is only max of 8kb per file but have many files(1000files in folder)

I am doing like this first trying to read the file

but error is coming what s the mistake please let me know i have attached my file.

Thanks a lot.
 
Paul Clapham
Sheriff
Pie
Posts: 20207
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
uma prem wrote:but error is coming what s the mistake


If you want other people to explain an error message, it would be a good idea if you told them what the error message said. Don't you agree?
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic